No1sonuk Posted March 17, 2022 Posted March 17, 2022 Is the address right? The one in my control reference says : DcsBios::LED landingGearHandleLt(0x747e, 0x0800, PIN); Miught be a different version of DCS-BIOS, though, but worth a check.
Vinc_Vega Posted March 18, 2022 Posted March 18, 2022 (edited) As the Mega pins 50 to 52 may be "reserved" for ICSP connections, try another pin for output. Regards, Vinc Edited March 18, 2022 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
amido Posted March 19, 2022 Author Posted March 19, 2022 thanks a lot guys, it was just the wrong command line, it was enough to replace "8" with "e" 1
amido Posted May 22, 2022 Author Posted May 22, 2022 small upgrades in the experimental phase .... and new 2nd screen
amido Posted May 31, 2022 Author Posted May 31, 2022 good evening everyone, if I put in the arduino sketch with dcs bios, both the commands for 18 together with those of 16 work the same or do I have to upload a new sketch divided by the two modules? thank you very much for helping
No1sonuk Posted May 31, 2022 Posted May 31, 2022 2 hours ago, amido said: good evening everyone, if I put in the arduino sketch with dcs bios, both the commands for 18 together with those of 16 work the same or do I have to upload a new sketch divided by the two modules? thank you very much for helping You CAN combine modules in the same Arduino, if that's what you're asking. I've done some experiments with using the same switches and LEDs with different aircraft. For LEDs, you can call the same "onChange" function from different aircraft lines, like this: #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #define mcLEDpin 13 // Common light function void onMasterCautionChange(unsigned int newValue) { if (newValue > 0) { digitalWrite (mcLEDpin, HIGH); // Turn on LED } else { digitalWrite (mcLEDpin, LOW); // Turn off LED } } // A-10 call DcsBios::IntegerBuffer masterCautionBuffer(0x1012, 0x0800, 11, onMasterCautionChange); // F-16 call DcsBios::IntegerBuffer lightMasterCautionBuffer(0x4476, 0x0080, 7, onMasterCautionChange); // P-51 landing gear red light DcsBios::IntegerBuffer landingGearRedBuffer(0x500e, 0x4000, 14, onMasterCautionChange); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } I tested that code in a Nano. On the P-51, pressing the Unsafe Landing Gear Light Test on the clickable cockpit turned on the LED. In the same DCS session, with no reset of the Arduino, the LED responded to the A-10 Master Caution light. I don't have the F-16 or F-18, so can't test those, but having the code in there didn't affect anything. You'd obviously need to check for address conflicts, and I may be missing some other issues, but that works for LEDs. After that worked, wondered if it works for switches as well, so I added this to the code above: #define mcSWpin 2 // Added at top of code DcsBios::Switch2Pos ufcMasterCaution("UFC_MASTER_CAUTION", mcSWpin); // A-10 Master Caution Switch DcsBios::Switch2Pos unsafeLndGearLtTest("UNSAFE_LND_GEAR_LT_TEST", mcSWpin); // P-51 landing gear red light test switch And now, a single switch on the Nano either activates the P-51 unsafe gear light test or the A-10 Master Caution reset depending on which aircraft you're using. Again, same caveat that there's no conflicts in these functions, but there might be in others.
amido Posted June 1, 2022 Author Posted June 1, 2022 (edited) thank you very much No1sonuk i will try and tell you if it works. Edited June 1, 2022 by amido
amido Posted August 12, 2022 Author Posted August 12, 2022 finished the electronics and Arduino programming, all working .... only the panels are missing 1
amido Posted August 26, 2022 Author Posted August 26, 2022 how can i insert in the lua file of the monitor also the digital instruments under the right DDI?
amido Posted September 4, 2022 Author Posted September 4, 2022 anyone who can explain to me how to export digital tools in monitor.lua file?
amido Posted October 1, 2022 Author Posted October 1, 2022 Hi, I can't get the 0.91 inch screen to work for the F18 ufc. this is the sketch : #define DCSBIOS_DEFAULT_SERIAL #include <DcsBios.h> #include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #define SCREEN_WIDTH 128 // OLED display ancho en pixels #define SCREEN_HEIGHT 32 // OLED display altura en pixels #define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); int count; ///////////////////////// SETUP ////////////////////////////////////////////////////////////// void setup() { count = 0; display.begin(SSD1306_SWITCHCAPVCC, 0x3C); display.clearDisplay(); display.setTextSize(1,2); display.setTextColor(WHITE); display.setCursor(0,0); display.cp437(true); display.print("N-A-12"); display.display(); display.setTextSize(1,2); DcsBios::setup(); } /////////////////////////// LOOP //////////////////////////////////////////////////////// void loop() { DcsBios::loop(); } ////////////////////////////Config Display /////////////////////////////////////////////////////// String comDisplay[2]; void updateComDisplay(int changed,char* newValue) { comDisplay[changed] = cleanUpCom(newValue); display.clearDisplay(); display.setCursor(0,0); display.print(comDisplay[0]); display.setCursor(35,0); display.print(comDisplay[1]); display.display(); } char* cleanUpCom(char* newValue) { switch (newValue[0]) { case '`': newValue[0]='1'; break; case '~': newValue[0]='2'; break; } return newValue; } //////////////////////////////////// DISPLAY UFC F18 ///////////////////////////////////////////////////// void onUfcOptionDisplay1Change(char* newValue) { updateComDisplay(0, newValue); } DcsBios::StringBuffer<4> ufcOptionDisplay1Buffer(0x7432, onUfcOptionDisplay1Change); I put the SDA and SCK contacts on the arduino mega 2560 in A5 and A4 there is something I can't understand, it doesn't give me any kind of error
amido Posted October 4, 2022 Author Posted October 4, 2022 (edited) ufc finished at 90%, now I'm trying to insert 0.91 inch screens. on the left side I have the master arm with the AA and AG modes, while on the right side I have the HOOK and HMD. Edited October 4, 2022 by amido
Recommended Posts