Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

ADF Gauge Help

Featured Replies

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

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

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.

  • 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

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

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.

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.