Jump to content

DCS-BIOS leds via controlers instead of pins


Recommended Posts

Posted

Hi there,

 

I'm fiddling with dcs-bios and would really love to flip LEDs on or off without having to sacrifice a pin per led. Obviously there are controlers like ht16k33 or even the max7219. But I can't figure out how to let dcs-bios play nice with these instead of a pin number.

 

Has anyone figured this out or have an idea of how to take this on?

 

cheers

Michel

Posted

Hi Michel, You could use the callbacks to capture a state change then set the LED manually.

 

 

something like this?

 

int g_apuLEDState = 0;
int g_ledstatechanged = false;

void onApuReadyLtChange(unsigned int newValue) 

{

[indent] g_apuLEDState = newValue;
g_ledstatechanged = true;
[/indent]

 }
DcsBios::IntegerBuffer apuReadyLtBuffer(0x54b2, 0x8000, 15, onApuReadyLtChange);


void loop()
{


[indent]if (g_ledstatechanged)
[/indent]



[indent] {
    //Call routine to drive shift-reg or LED controller, pass in LED state.
    g_ledstatechanged = false;

}
[/indent]

}

  • 4 months later...
  • Recently Browsing   0 members

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