Marty62 Posted November 25, 2024 Posted November 25, 2024 Hi Folks I have built a replica keyboard modelled after the unit in the AH64. It uses a 20X1 LCD Display ( Make - Crystalfontz, Model CFAH2001B-TMI-ET, Revision B0 ) The display is driven by an Arduino Nano and the key buttons are driven through a Leo Bodinar 64 Button board I have managed to get the basic " Hello World " sketch working fine on the display but I need a bit of help with introducing the display reference code from the dcs bios reference document. My Basic Arduino Code is as below, which is producing the " hello world " and the counter code directly after the wording, that is working perfectly! Due to the fact that I am driving all the letter and number buttons on the keyboard via the Leo Bodinar board as a HID, I don't believe I need any other code from the DCS-BIOS reference other than the code for the display itself which is listed at the bottom of the page. I have attempted this myself and let me be clear " I am obviously not, code smart enough yet, but I am learning If someone could assist me with fitting the display code into my current working code, I would be eternally grateful Regards Martin BASIC WORKING CODE #define DCSBIOS_IRQ_SERIAL // include the library code: #include <LiquidCrystal.h> #include "DcsBios.h" // initialize the library by associating any needed LCD interface pin // with the arduino pin number it is connected to const int rs = 2, en = 3, d4 = 8, d5 = 9, d6 = 10, d7 = 13; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup() { // set up the LCD's number of columns and rows: lcd.begin(20, 1); // Print a message to the LCD. lcd.print("hello, world!"); } void loop() { // set the cursor to column 0, line 1 // (note: line 1 is the second row, since counting begins with 0): lcd.setCursor(15, 1); // print the number of seconds since reset: lcd.print(millis() / 1000); DcsBios::loop(); } MPORTED DCS-BIOS DISPLAY CODE void onPltKuDisplayChange(char* newValue) { /* your code here */ } DcsBios::StringBuffer<22> pltKuDisplayBuffer(AH_64D_PLT_KU_DISPLAY_A, onPltKuDisplayChange);
Recommended Posts