longuich Posted September 19, 2019 Posted September 19, 2019 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
Blue73 Posted September 20, 2019 Posted September 20, 2019 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] }
longuich Posted February 19, 2020 Author Posted February 19, 2020 oh hey mate, I never caught your response. But love the lead tho. thanks heeps! cheers, michel
Recommended Posts