OscarVictor11 Posted October 12, 2021 Posted October 12, 2021 I've been in the process of building an F18 UFC and have completed the 'easy ' bit, ie wiring the main switches and buttons, but have hit a problem with the character displays. I cant seem to find a simple example of a DCS-Bios and Arduino Mega sketch that would drive a 16 x 2 lcd to provide the Comm 1 and 2 frequencies. I understand the basic construction of how the sketch is put together ie the various library's needed to drive the display but the only example online I can find is a youtube demo, which is clearly well meant, but is not at all straightforward to follow or implement. Can anyone suggest a likely sketch outline that would illustrate how I might achieve a simple 16 x 2 display that shows the selected radio frequency?. I'm using an Arduino Mega 2560/ Seeed Industries Grove LCD RGB Backlight 16 x 2 (I2c) and related library. many thanks.
No1sonuk Posted October 13, 2021 Posted October 13, 2021 I don't have the F-18, but I could possibly knock something together using the "Flightpanels Fork" command reference. Could you link to the video you mentioned, and I'll have a look.
Vinc_Vega Posted October 14, 2021 Posted October 14, 2021 (edited) Are you able to send a simple text message to your display or is the question strictly DCS related? Would you please post the code that you have so far? Regards, Vinc Edited October 14, 2021 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
OscarVictor11 Posted December 13, 2021 Author Posted December 13, 2021 I am in the process of building an F18 UFC panel with the scratchpad and selection displays but cannot seem to write the Arduino/Dcs Bios sketch to present the Scratch Pad info. I have no previous computer or electronics skills so the process has been a fair old challenge. I'm using a Leo Bodnar for the switches and an Arduino Mega together with a Grove Base Shield V2 for the i2c LCD (Grove-Lcd RGB Backlight) i2c display. Having selected the suggested 'IRQ serial connection' and copied the relevant libraries for the sketch as shown below, I can compile as far as this. I know there are some line's of code missing but whatever I try fails to compile. The main source of instruction has been two youtube demos, both of which, with the best of intent, are confusing and fail to logically demonstrate fully. Having used the Arduino/ Grove base shield and the 16 x 2 Grove display I can easily install the ' Hello World ' sketch, change this to other info such as Com 1 140.000 in various colors so the kit works fine. Its the implementation of the scratchpad info that's proving to be difficult and any help would be much appreciated. #include <Wire.h> #include <rgb_lcd.h> /* Tell DCS-BIOS to use a serial connection and use interrupt-driven communication. The main program will be interrupted to prioritize processing incoming data. This should work on any Arduino that has an ATMega328 controller (Uno, Pro Mini, many others). */ #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" rgb_lcd lcd; } void onUfcScratchpadNumberDisplayChange(char* newValue) { /* your code here */ } DcsBios::StringBuffer<8> ufcScratchpadNumberDisplayBuffer(0x7446, onUfcScratchpadNumberDisplayChange); /* paste code snippets from the reference documentation here */ void setup() { DcsBios::setup(); lcd.begin(16, 2); } void loop() { DcsBios::loop();
Recommended Posts