Heli Shed Posted January 17 Posted January 17 (edited) Hello all, hope you are all well? I got this for Christmas: GeeekPi IIC/I2C 2004 20x4 Character LCD Module Display, Support I2C Protocol, LCD 2004 Module Shield for Arduino Uno Raspberry Pi I've managed to get it working but not with DCS BIOS. To be honest, I haven't the foggiest of what i'm doing with it in DCS BIOS or what i could use it to display. For some context of my abilities, I've built about 8 panels, dual apache and F18C. Comfortable with Arduino IDE, Bort, DCS BIOS (FP Fork) for switches, buttons, LEDs, potentiometers and Encoders. I've nearly finished the lot and will be doing a series on it on my YouTube Channel. My last video (an alternative 12 days of christmas heli focused) if you watch it you see some of the panels in it. Out of 10, being say a tek creations panel set, mine are an 8 I'd say. They are good - even the wife says so and 3 months of maticulous Heli Shed time, acrylic, laser cutting, engraving and about 500 quid later, I got what i wanted. My own custom panels. Pic below gives some context. It's a custom pit essentially, mixture of DCS BIOS, HID, WinWing Top Gun, Tek Creations kit, home made panels, 2x10inch touch Screen and Helios, mated to a 65inch 4k gaming TV. Bloody amazing. You might be able to see just behind the stick that i have made a wooden box as a placeholder for another custom panel - i intend to use this as a panel for light indication - SAM, Speed Brake, AAA, Xmit etc etc. I fly almost excluisivly in Alt F1 Hud only view. So.............. any ideas what i could use it for? As well as what on earth would be the coding for it? Very greatful for some examples (copy and paste would be nice) - hell, I'm happy to pay for it if needs be. Bless ya - safe flying. T Edited January 17 by Heli Shed additional context and spelling........ Come pay us a visit on YouTube - search for HELI SHED
No1sonuk Posted January 18 Posted January 18 I find such LCDs to be REALLY useful when debugging - you can make them display parameters while you're trying to figure out other controls, etc. Assuming you have the F-18, you can try this straight off. If not, use it as a guide. This sketch should show the COMM 1 and 2 frequencies on the 20x4 LCD. I don't know if the AM/FM mode information is available. This should give you enough to go on. You'll need to install the LiquidCrystal_I2C.h library in the IDE. Tested just now on Arduino Uno, but it should work on most others. #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27,20,4); // set the LCD address to 0x27 for a 20 chars and 4 line display void onComm1Change(char* newValue) { lcd.setCursor(0,0); // Column, row lcd.print("COMM 1: "); // Clear the line lcd.setCursor(8,0); lcd.print(newValue); } DcsBios::StringBuffer<7> comm1Buffer(FA_18C_hornet_COMM1_A, onComm1Change); void onComm2Change(char* newValue) { lcd.setCursor(0,1); lcd.print("COMM 2: "); // Clear the line lcd.setCursor(8,1); lcd.print(newValue); } DcsBios::StringBuffer<7> comm2Buffer(FA_18C_hornet_COMM2_A, onComm2Change); // ********************************** void setup() { DcsBios::setup(); lcd.init(); // initialize the lcd lcd.backlight(); lcd.setCursor(0,0); // column, row lcd.print("COMM 1: "); // Clear the line lcd.setCursor(0,1); lcd.print("COMM 2: "); // Clear the line } void loop() { DcsBios::loop(); }
No1sonuk Posted January 18 Posted January 18 BTW, the LCD connects to +5V and GND for power. SDA and SCL for I2C data. Those are on A4 (SDA) and A5 (SCL) on the Uno. If you're using a different device, check where those pins are. Some Arduinos have separated pins for SDA and SCL, but they still connect to the other I/O pins listed. e.g. my Arduino Uno has pins labelled SDA and SCL in the far corner from A4 and A5, but they're still connected there.
Recommended Posts