CYPHER11 Posted March 15 Posted March 15 Hey Guys, currently trying to figure out how to expand the ports on the Nano with Multiplexer or MCP23017. I tried both but i can´t get it to work with DCS BIOS. I am using the latest Skunkwork Library. I think, i should start from scratch. So here is the Idea: I want to built an Kiowa MFK. So in total, i have 51 Inputs. I want to create a PCB on the back of the MFK and use an Arduino Nano with one USB Cable coming from it. I need to extend the inputs for that. What would you guys suggest is the easiest Method for extending the Ports of the Nano which is still comatible with DCS BIOS? i really appreciate any kind of help. Also for future Projects it would also be cool to know if i want to use a Huge amount of LED´s with DCS BIOS, is the Multiplexer / MCP23017 the right choice? Do i need a complete different approach? Thanks in advance for any help
No1sonuk Posted March 15 Posted March 15 (edited) DCS-BIOS will natively work only with the ports ON the processor. If you want to use more through multiplexers and expanders, you have to write all the code to handle that yourself, then use the sendDcsBiosMessage function in DCS-BIOS to send the switch signals to DCS. You MIGHT be able to do it with a Nano using a matrix, but you're pushing it for that many inputs, AND remember that you CANNOT use pins D0 and D1 AT ALL with an Arduino running DCS-BIOS because they are used for the USB comms. 1 hour ago, CYPHER11 said: i really appreciate any kind of help. Also for future Projects it would also be cool to know if i want to use a Huge amount of LED´s with DCS BIOS, is the Multiplexer / MCP23017 the right choice? Do i need a complete different approach? MAX7219 LED drivers are a popular choice. 64 LEDs from one device. They can make eight 7-segment (plus decimal point) numerical displays or an 8x8 matrix, and a few can be "daisy-chained" to save IO pins. There's also the addressable LEDs - commonly called "Neopixels" after Adafruit's implementation of them. Edited March 15 by No1sonuk 1
CYPHER11 Posted March 16 Author Posted March 16 23 hours ago, No1sonuk said: DCS-BIOS will natively work only with the ports ON the processor. If you want to use more through multiplexers and expanders, you have to write all the code to handle that yourself, then use the sendDcsBiosMessage function in DCS-BIOS to send the switch signals to DCS. You MIGHT be able to do it with a Nano using a matrix, but you're pushing it for that many inputs, AND remember that you CANNOT use pins D0 and D1 AT ALL with an Arduino running DCS-BIOS because they are used for the USB comms. MAX7219 LED drivers are a popular choice. 64 LEDs from one device. They can make eight 7-segment (plus decimal point) numerical displays or an 8x8 matrix, and a few can be "daisy-chained" to save IO pins. There's also the addressable LEDs - commonly called "Neopixels" after Adafruit's implementation of them. Hey No1Sonuk, thanks for the quick answer. When I use sendDcsBiosMessage function Arduino IDE tells me it‘s not part of the Library:/
No1sonuk Posted March 16 Posted March 16 How are you trying to do it? The format is: sendDcsBiosMessage("MESSAGE", argument);
CYPHER11 Posted March 17 Author Posted March 17 On 3/16/2025 at 5:55 PM, No1sonuk said: How are you trying to do it? The format is: sendDcsBiosMessage("MESSAGE", argument); Example: #include <DcsBios.h> #define MUX_SIG_PIN 6 // Der SIG-Pin des Multiplexers, an den dein Taster angeschlossen ist #define S0 2 #define S1 3 #define S2 4 #define S3 5 void selectMuxChannel(byte channel) { digitalWrite(S0, channel & 0x01); digitalWrite(S1, (channel >> 1) & 0x01); digitalWrite(S2, (channel >> 2) & 0x01); digitalWrite(S3, (channel >> 3) & 0x01); } void setup() { DcsBios::setup(); // Steuerpins für Multiplexer als Ausgang setzen pinMode(S0, OUTPUT); pinMode(S1, OUTPUT); pinMode(S2, OUTPUT); pinMode(S3, OUTPUT); // SIG-Pin als Eingang mit Pullup setzen pinMode(MUX_SIG_PIN, INPUT_PULLUP); } void loop() { DcsBios::loop(); // Den Multiplexer auf den Kanal einstellen, wo der Taster ist (z.B. Kanal 0) selectMuxChannel(0); delay(5); // Kleines Delay, um den Multiplexer umzuschalten if (digitalRead(MUX_SIG_PIN) == LOW) { sendDcsBiosMessage("MASTER_CAUTION_RESET_SW", "TOGGLE"); delay(250); // Kurze Pause, um Mehrfachauslösungen zu vermeiden } } That´s what i tried.... Thank you for helping
No1sonuk Posted March 17 Posted March 17 OK. That should compile. What error message is it giving? However, I'm not sure that code will do what you want. There's nothing stopping the MASTER_CAUTION_RESET_SW toggling every loop while the button is down.
Vinc_Vega Posted March 22 Posted March 22 (edited) If you still have issues to talk to the MCP23017, you may have a look how I described usage of that pin extender within my VHF FM radio panel. Btw. the tryToSendDcsBiosMessage commands can be replaced by your sendDcsBiosMessage code. Have a nice weekend, Regards, Vinc Edited March 24 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
CYPHER11 Posted April 7 Author Posted April 7 On 3/22/2025 at 9:33 AM, Vinc_Vega said: If you still have issues to talk to the MCP23017, you may have a look how I described usage of that pin extender within my VHF FM radio panel. Btw. the tryToSendDcsBiosMessage commands can be replaced by your sendDcsBiosMessage code. Have a nice weekend, Regards, Vinc Hey Vinc, Thanks for the input i´ll give a try. Maybe i just switch to shift register since they seem to be more easy - but we will see =D I keep you guys updated
Recommended Posts