Robo76 Posted February 15 Posted February 15 (edited) I installed DCS-Bios (Skunkworks) and Arduino Uno + LCD (16x2) with USB COM3 connection using i-tec USB 3.0 Charging HUB 13 port. If there is no communication with DCS, everything works properly, LCD is lit and displays what I enter. As soon as I connect communication with DCS using DCS BiosBridge (defaut communication settings), the LCD displays the correct value (Heading), but then it flashes about 2 times and goes out. When I turn off communication with DCS, the LCD works again. Anyone know what is the fault ? Translated with www.DeepL.com/Translator #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display int TRUEheading = 0; void screen0() { lcd.setCursor(0,0); lcd.print("Heading: "); lcd.setCursor(9,0); lcd.print(TRUEheading); } /* paste code snippets from the reference documentation here */ void onHdgDegChange(unsigned int newValue) { TRUEheading = newValue; screen0(); } DcsBios::IntegerBuffer hdgDegBuffer(0x0436, 0x01ff, 0, onHdgDegChange); void setup() { DcsBios::setup(); lcd.init(); // zapnutí LCD lcd.clear(); lcd.backlight(); // zapne podsvícení LCD screen0(); } void loop() { DcsBios::loop(); } Edited February 15 by Robo76
No1sonuk Posted February 15 Posted February 15 Try using the "manual" connection programs (SOCAT). DCSBios bridge has some issues, and this may just be how it manifests itself on your estup.
Robo76 Posted March 5 Author Posted March 5 On 2/15/2025 at 1:15 PM, No1sonuk said: Try using the "manual" connection programs (SOCAT). DCSBios bridge has some issues, and this may just be how it manifests itself on your estup. I tried, but the result is the same as with DCS BIOSBridge, see video
No1sonuk Posted March 6 Posted March 6 That's very odd. The fact that the backlight goes out indicates it might be a problem with the hub power. Try this: void setup() { DcsBios::setup(); lcd.init(); // zapnutí LCD lcd.clear(); lcd.backlight(); // zapne podsvícení LCD TRUEheading = 400; // Set to a value DCS won't produce to indicate startup condition screen0(); delay(4000); // Wait 4 seconds TRUEheading = 0; // Set to 0 screen0(); } That sets the TRUEheading variable to a number DCS won't produce so you can see if the displayed number is a result of startup. If the power is being cut, after the LCD comes back on, it should sit at 400 for 4 seconds, then reset to 0. Don't forget to wait until the display is 0 before the first connection to DCS after turning on the Arduino. If that happens, the next thing I'd try is direct connection to a USB port on the computer - maybe the hub is causing a problem. If eliminating the hub doesn't fix it, it might be the display updating that's causing the problem. Try changing the code to this: void onHdgDegChange(unsigned int newValue) { TRUEheading = newValue; // screen0(); // Disable this line for testing } That should stop the code updating the display, but leave everything else working the same. This is testing if the display updating too quickly is causing the problem (Though that problem should look different to what you showed).
Recommended Posts