Please excuse the rookie question but I want to be sure I don't damage the Arduino....

I'm using a bi-color (red/green) LED with a common ANODE for the gear indicators. The anode is connected to the 5v pin with a resistor and each cathode (one for green, one for red) are connected to digital pins (38 & 39).

If using an Arduino sketch, I reverse logic to ground the terminal high to keep the respective LED in the off state and low to make it glow (i.e. "digitalWrite(38, HIGH);" turns it off and "digitalWrite(38, LOW);" makes it go on).

Does the Sim Vim programing require using only common cathode LEDs or will it ground the pin automatically when necessary? If not, can it be user modified to reverse the polarity when X-Plane signals the indicators?

Thanks!

1 month ago in LEDs, Digital Output by

1 Answer

Use the DM13 drivers with common anode LEDs - https://simvim.com/svc_digout.html
Or invert direct connection with transistor: https://simvim.com/tech_dout.html
Vlad
1 month ago by
Thank you very much for the quick answer. I was hoping there was a programming solution (i.e. 0 = off, 1 = on) but as I am only using just the 3 LEDs, it will be cheaper and easier to buy the common cathode variety verses the common anode ones I already had lying around from an old project. If nothing else, hopefully this post will help others assure they are using the correct polarity LEDs. Thanks for this great project and resources!

You can try  to add the f=i  after the parameter name:

L38  Nose_Gear_Green  f=i
L39  Nose_Gear_Red      f=i

But it's not universal, and can be used for some outputs (including gear LEDs)

Vlad

Excellent! That absolutely works. The only issue is that when I exit the program it leaves the pins in the connected state so the LEDs stay on until the Arduino card is de-powered but I can make that work. Thank you SO much.
...