September 3, 200718 yr I have made a " ADF " digital gauge, that shows me the direction to the NDB. I have a radio stack that, I use to tune in the various radio frequencies. The ADF gauge works great, however if I am not within range of the NDB or I do not have a frequency tuned in, the gauge always reads 90 degrees (i guess this is the default). I would like for the gauge to display a few dashes, if I do not have a frequency tuned in. If I am tuned to a ADF frequency, then I want the gauge to show me the direction to the NDB.Here is the code that I am using for the gauge. I can't find any combination of "IF" "ELSE" statements that work. Is there a boolean value that could be used to check on the ADF status. There must be a simple solution, but I haven't found it.(A:Circuit general panel on, bool)(G:Var2) 0 == (A:Avionics master switch, bool) &&%(360 (A: Plane heading degrees gyro, degrees) (A:ADF1 Radial,degrees) + dnor near d 0 == ?)%!03d!° To NDB Thanks greenco
September 3, 200718 yr Commercial Member I believe you might want to check the value in ADF SIGNAL STRENGTH. Ed Wilson Mindstar AviationMy Playland - I69
September 3, 200718 yr Thanks, that did it. I was trying to place some code inside of the gauge "elements" and all I neede to do was use this line of code:(A:ADF1 SIGNAL, bool)If I don't have a signal tuned in, the gauge is blank. That is OK because when I get a reading I know I am in range of the NDB that I have tuned.Thanks again
September 5, 200718 yr I am still trying to get my ADF gauge to display "dashes" when I am not tuned to a ADF frequency. Why does this code not work?if(A:ADF1 SIGNAL, bool){ %(360 (A: Plane heading degrees gyro, degrees) (A:ADF1 Radial,degrees) + dnor near d 0 == ?)%!03d! }els{ - - - }If I omit the last line with the "els" condition it works like this. If I DO have a frequency tuned it it shows me the direction to the NDB. If I DO NOT have a frequency tuned in, it displays " 090 " . If I leave the last line with the "els" condition in the code, the gauge displays - - - ,all the time, regardless if I have a frequency tuned or not.
September 6, 200718 yr Author Moderator You have your if in the wrong place! You have to think "in reverse..."(A:ADF1 SIGNAL, bool)if{ %(360 (A: Plane heading degrees gyro,degrees) (A:ADF1 Radial,degrees) + dnor near d 0 ==?)%!03d! }els{ - - - } Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
September 6, 200718 yr Try this%((A:ADF1 SIGNAL, bool))%{if}%( 360 (A:Plane heading degrees gyro,degrees) (A:ADF1 Radial,degrees) + dnor near d 0 == ?)%!03d!%{else}-------%{end} Paul EGLD
September 6, 200718 yr Thanks Bill and pve.Bill I could not get your example to work. It displayed "dashes" all the time, regardless if a frequency was tuned in or not.pve, your example worked great! I have placed the code into my XML archive for future reference.
September 6, 200718 yr Author Moderator >Thanks Bill and pve.>>Bill I could not get your example to work.That's not too surprising, as I suck at XML myself... ;)I'm a dyed-in-the-wool C coder... Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
Create an account or sign in to comment