Jump to content

Recommended Posts

Posted
On 8/12/2022 at 1:09 PM, No1sonuk said:

Then use the active high version - it's what the LED code was designed for.

Ouch! That is going to be a pain. will need to switch wires and re-solder. will give it a try.

 

Posted

You can use the code if it's too much hassle to rewire.

I've done it for driving Neopixel addressable LEDs.  Try this in the code function:

if (newValue == 1){digitalWrite(LEDPIN, LOW);}

else{digitalWrite(LEDPIN,HIGH);}

That should do it.

 

  • Like 1
Posted (edited)
On 8/14/2022 at 5:39 AM, No1sonuk said:

You can use the code if it's too much hassle to rewire.

I've done it for driving Neopixel addressable LEDs.  Try this in the code function:

if (newValue == 1){digitalWrite(LEDPIN, LOW);}

else{digitalWrite(LEDPIN,HIGH);}

That should do it.

 

Great, it would be a real pain, I'm also using 3.3v instead of 5v. Didn't know if this would cause a problem as well.

 

Regardless, would this code be correct for the Left Elevator Idicator LED?

would it go in the main, setup or loop section?

 

Example: 

Left Elevator EMER DISENG Indicator (yellow)

void onLElevatorEmerDisengageChange(unsigned int newValue) {

if (newValue == 1){digitalWrite(LEDPIN, LOW);}

else{digitalWrite(LEDPIN,HIGH);}

}
DcsBios::IntegerBuffer lElevatorEmerDisengageBuffer(0x10da0x01008onLElevatorEmerDisengageChange);

 

 

Edited by byteman59
Posted

The power voltage doesn't affect the code unless you're measuring voltages.

That code goes where all the DCS-BIOS lines go - usually above the setup, outside the setup or loop. They're functions in their own right.

I don't have access to the control reference right now, so I don't know if the numbers are right.

Posted

btw

No1sonuk, how does one know all the commands in DCS-Bios? Is all the code possible available in hte DCS-Bios Reference Chart?

I want to learn as much as i can about the programming of DCS-Bios.

 

Thanks

 

Posted
2 hours ago, byteman59 said:

btw

No1sonuk, how does one know all the commands in DCS-Bios? Is all the code possible available in hte DCS-Bios Reference Chart?

I want to learn as much as i can about the programming of DCS-Bios.

In the DCS-BIOS Arduino library examples, there's a "one of everything" sketch.

If you want to learn how those commands work, you can look in the Arduino library source code.
BE CAREFUL not to accidentally edit them, though, in case you screw something up.
On my computer, those files are located here:
C:\Users\timja\Documents\Arduino\libraries\dcs-bios-arduino-library-0.3.7\src\internal

Looking at the LED code in there, it possibly wouldn't take much effort to add an active low type, or a flag that can be set if required.  The 2 position switch has that.

Posted (edited)
On 8/14/2022 at 5:39 AM, No1sonuk said:

You can use the code if it's too much hassle to rewire.

I've done it for driving Neopixel addressable LEDs.  Try this in the code function:

if (newValue == 1){digitalWrite(LEDPIN, LOW);}

else{digitalWrite(LEDPIN,HIGH);}

That should do it.

 

It worked great, thank you!

pinMode(PIM, OUTPUT) needs to be set as well, in setup

 

Edited by byteman59
  • Like 1
Posted

FYI.  I submitted code to the Flightpanels guys that would replace the LED function with one where you can add ",false" on the end to invert it.  No idea when it'll make it to the full "build", though.

  • Like 1
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...