No1sonuk Posted May 11, 2020 Share Posted May 11, 2020 Regarding DCS-BIOS over RS485: 1) Does a slave unit transmit any data to the master, such as on power-up or idling, if you don't send any data from the slave device. i.e. if you're using the slave to drive gauges, but no switches. 2) If there's no data in (1), could slaves share an address? Link to comment Share on other sites More sharing options...
BlackLibrary Posted May 11, 2020 Share Posted May 11, 2020 @Roger fixed and uploaded to master branch. i also made a new sorting. pls test it and give feedback aka WarLord DCSFlightpanels DCS-BIOS Fork DCSFlightpanels arduino-library DCSFlightpanels DCSFlightpanels-Profiles DCS FP / BIOS Discord Server Link to comment Share on other sites More sharing options...
Roger01 Posted May 11, 2020 Share Posted May 11, 2020 Have tested 5/6 switch on 2 panels + flashlight. All are ok! Thank you, nice work!:thumbup::clap: Link to comment Share on other sites More sharing options...
amido Posted May 18, 2020 Share Posted May 18, 2020 hi, I wanted to put the led for AA and AG but it gives me the following error, where am I wrong? UFC_F18_amido:44:26: error: conflicting declaration 'DcsBios::LED masterModeAg' DcsBios::LED masterModeAg(0x740c, 0x1000, 25); ^ C:\Users\nicola\Documents\Arduino\1\UFC_F18_amido\UFC_F18_amido.ino:43:21: note: previous declaration as 'DcsBios::Switch2Pos masterModeAg' DcsBios::Switch2Pos masterModeAg("MASTER_MODE_AG", 25); ^~~~~~~~~~~~ exit status 1 conflicting declaration 'DcsBios::LED masterModeAg' and this is the ide script: /* 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" /* paste code snippets from the reference documentation here */ DcsBios::Switch2Pos ufcClr("UFC_CLR", 44); DcsBios::Switch2Pos ufcEnt("UFC_ENT", 42); DcsBios::Switch2Pos ufc1("UFC_1", 53); DcsBios::Switch2Pos ufc2("UFC_2", 52); DcsBios::Switch2Pos ufc3("UFC_3", 51); DcsBios::Switch2Pos ufc4("UFC_4", 50); DcsBios::Switch2Pos ufc5("UFC_5", 49); DcsBios::Switch2Pos ufc6("UFC_6", 48); DcsBios::Switch2Pos ufc7("UFC_7", 47); DcsBios::Switch2Pos ufc8("UFC_8", 46); DcsBios::Switch2Pos ufc9("UFC_9", 45); DcsBios::Switch2Pos ufc0("UFC_0", 43); DcsBios::Switch2Pos ufcOs1("UFC_OS1", 41); DcsBios::Switch2Pos ufcOs2("UFC_OS2", 40); DcsBios::Switch2Pos ufcOs3("UFC_OS3", 39); DcsBios::Switch2Pos ufcOs4("UFC_OS4", 38); DcsBios::Switch2Pos ufcOs5("UFC_OS5", 37); DcsBios::Switch2Pos hudAltSw("HUD_ALT_SW", 36); DcsBios::Switch2Pos ufcAp("UFC_AP", 35); DcsBios::Switch2Pos ufcBcn("UFC_BCN", 30); DcsBios::Switch2Pos ufcDl("UFC_DL", 31); DcsBios::Switch2Pos ufcIff("UFC_IFF", 34); DcsBios::Switch2Pos ufcIls("UFC_ILS", 32); DcsBios::Switch2Pos ufcOnoff("UFC_ONOFF", 29); DcsBios::Switch2Pos ufcTcn("UFC_TCN", 33); DcsBios::Switch2Pos ufcComm1Pull("UFC_COMM1_PULL", 28); DcsBios::Switch2Pos ufcComm2Pull("UFC_COMM2_PULL", 27); DcsBios::Switch2Pos masterArmSw("MASTER_ARM_SW", 26); DcsBios::Switch2Pos masterModeAa("MASTER_MODE_AA", 24); DcsBios::Switch2Pos masterModeAg("MASTER_MODE_AG", 25); DcsBios::LED masterModeAa(0x740c, 0x0800, 23); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } Link to comment Share on other sites More sharing options...
lesthegrngo Posted May 19, 2020 Share Posted May 19, 2020 (edited) Guys, as part of trying to resolve an issue with a TFT screen with strange characters, I am being asked to provide the raw HEX output data that the game sends to DSC BIOS I tried to use the serial monitor to see what was being transmitted while the game was running, but it says 'port XX blocked' so I can't use the serial monitor for exctracting the data Is there any way to get this? Cheers Les Edited May 19, 2020 by lesthegrngo Link to comment Share on other sites More sharing options...
Hansolo Posted May 19, 2020 Share Posted May 19, 2020 hi, I wanted to put the led for AA and AG but it gives me the following error, where am I wrong? UFC_F18_amido:44:26: error: conflicting declaration 'DcsBios::LED masterModeAg' DcsBios::LED masterModeAg(0x740c, 0x1000, 25); ^ C:\Users\nicola\Documents\Arduino\1\UFC_F18_amido\UFC_F18_amido.ino:43:21: note: previous declaration as 'DcsBios::Switch2Pos masterModeAg' DcsBios::Switch2Pos masterModeAg("MASTER_MODE_AG", 25); ^~~~~~~~~~~~ exit status 1 conflicting declaration 'DcsBios::LED masterModeAg' In the above you have masterModeAg appearing twice AND you are using the same pin number for both input and output. Try and rename the LED's to; DcsBios::LED masterModeAa_(0x740c, 0x0800, 23); DcsBios::LED masterModeAg_(0x740c, 0x1000, 22); And see if that works for you Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album Link to comment Share on other sites More sharing options...
amido Posted May 20, 2020 Share Posted May 20, 2020 thanks a lot, I solved the problem. Link to comment Share on other sites More sharing options...
ZBoT Posted May 23, 2020 Share Posted May 23, 2020 Is it possible to use a standard joystick buttons/switches to input to DCS BIOS? I have some button boxes I made that are standard HID joysticks (buttons/toggle switches). I would like to use them to "talk" to DCS-BIOS to have it map the controls. That way I don't have to pull my hair out trying to edit .lua files to get the 2-way toggle switches to work correctly, etc. Windows 10 x64 | i5-9600K | ASUS RTX 2080 8GB | 32GB DDR4 3200 | 256GB & 1TB SSD | GIGABYTE Z390 | TM Warthog HOTAS | Virpil WarBRD | Slaw RX Viper v2 | TrackIR 5 | Buddy-Fox A-10C UFC Link to comment Share on other sites More sharing options...
No1sonuk Posted May 23, 2020 Share Posted May 23, 2020 Is it possible to use a standard joystick buttons/switches to input to DCS BIOS? I have some button boxes I made that are standard HID joysticks (buttons/toggle switches). I would like to use them to "talk" to DCS-BIOS to have it map the controls. That way I don't have to pull my hair out trying to edit .lua files to get the 2-way toggle switches to work correctly, etc. If DCS recognises the device, can't you map it in the controls screen? Other than that, you'd need to connect the device to an Arduino and do it from there. Link to comment Share on other sites More sharing options...
ZBoT Posted May 23, 2020 Share Posted May 23, 2020 If DCS recognises the device, can't you map it in the controls screen? Other than that, you'd need to connect the device to an Arduino and do it from there. Yes I can map the switches in the control screen but on/off 2-way toggle switches don't behave properly. So one has to modify the joystick .lua file to make it work like it is supposed to. This is a common issue. If DCS Bios could interact with a joystick, it would be much easier to control these devices. Windows 10 x64 | i5-9600K | ASUS RTX 2080 8GB | 32GB DDR4 3200 | 256GB & 1TB SSD | GIGABYTE Z390 | TM Warthog HOTAS | Virpil WarBRD | Slaw RX Viper v2 | TrackIR 5 | Buddy-Fox A-10C UFC Link to comment Share on other sites More sharing options...
No1sonuk Posted May 23, 2020 Share Posted May 23, 2020 If DCS Bios could interact with a joystick, it would be much easier to control these devices. If it's one of the old analogue sticks it should be easy as connecting via discrete lines into an Arduino. If it's a USB stick, you'd have to create a new interface device. Link to comment Share on other sites More sharing options...
Mountaineer86 Posted May 27, 2020 Share Posted May 27, 2020 Does anybody have an up to date approach for utilizing I/O expanders with dcs bios on arduino? I'm trying to get it to work but man... What type of I/O expander chip are you referencing? I see MCP23017 mentioned and I have gotten 74hc595 to work for outputs. Link to comment Share on other sites More sharing options...
Guppy Posted May 28, 2020 Share Posted May 28, 2020 Hey guys having an issue with the Hornet LST/NFLR switch. I've tried two ways: DcsBios::Switch2Pos lstNflrSw("LST_NFLR_SW", 9); and const byte lstNflrSwPins[3] = {9, 10}; DcsBios::SwitchMultiPos lstNflrSw("LST_NFLR_SW", lstNflrSwPins, 3); The switch will not move, I've tried different toggle switches just incase it was a mechanical issue. Arduino reads it, DCS does nothing. Interestingly it will send signals and move the FLIR switch. Any ideas My Simpit Progress and Update Learn how to build a SimPit like mine: Follow my Blog here! Link to comment Share on other sites More sharing options...
BlackLibrary Posted May 28, 2020 Share Posted May 28, 2020 its false programmed. fix is uploaded In our Fork aka WarLord DCSFlightpanels DCS-BIOS Fork DCSFlightpanels arduino-library DCSFlightpanels DCSFlightpanels-Profiles DCS FP / BIOS Discord Server Link to comment Share on other sites More sharing options...
Guppy Posted May 28, 2020 Share Posted May 28, 2020 its false programmed. fix is uploaded In our Fork uploaded where? I'm sorry? My Simpit Progress and Update Learn how to build a SimPit like mine: Follow my Blog here! Link to comment Share on other sites More sharing options...
BlackLibrary Posted May 28, 2020 Share Posted May 28, 2020 Flightpanels BIOS. But is incompatible with hub version aka WarLord DCSFlightpanels DCS-BIOS Fork DCSFlightpanels arduino-library DCSFlightpanels DCSFlightpanels-Profiles DCS FP / BIOS Discord Server Link to comment Share on other sites More sharing options...
Guppy Posted May 28, 2020 Share Posted May 28, 2020 Flightpanels BIOS. But is incompatible with hub version I guess I don't understand the difference. I use DCS BIOS with my own homemade panels using Arduino boards and switches; specifically the Mega. IDK how to make it work with that. My Simpit Progress and Update Learn how to build a SimPit like mine: Follow my Blog here! Link to comment Share on other sites More sharing options...
Guppy Posted June 12, 2020 Share Posted June 12, 2020 I've got another question for you all. To display the RPM for the L or R engine the string buffer is set as 2. This works fine when the RPMs are <100, however when the value is >= 100 it truncates the last digit. I'm outputting to a OLED. IE: 98 displays as 98; 100 displays as 10. In order to resolve this I set the string value to 3. Now this works for >= 100 but not for <100. IE: 98 displays as 989; 100 displays as 100. Any solution with the Arduino code to work around this? I understand in theory how to do this IE: If value <100 String = 2 elseif >= 100 string = 3... however I'm not very good with arduino syntax yet. My Simpit Progress and Update Learn how to build a SimPit like mine: Follow my Blog here! Link to comment Share on other sites More sharing options...
No1sonuk Posted June 12, 2020 Share Posted June 12, 2020 Any solution with the Arduino code to work around this? I understand in theory how to do this IE: If value <100 String = 2 elseif >= 100 string = 3... however I'm not very good with arduino syntax yet. Not sure how your specific code works, but try this:if (value <100) { string = 2; // or whatever code sets String to 2 } else { string = 3; // or whatever code sets String to 3 } You only need "elseif" if you want to specifically test for another value. "else" on its own covers everything not sorted by the previous "if" or "elseif" tests. Link to comment Share on other sites More sharing options...
Guppy Posted June 12, 2020 Share Posted June 12, 2020 Thanks No1sonuk... this totally makes sense. however, regardless of where I put this I'm getting an exit status 1 "expected primary-expression before 'if'. Here is where i've been trying to place it: Above this I have my custom font, library, etc. char* RpmL; char tmp_string[8]; U8GLIB_SSD1306_128X32 u8g(U8G_I2C_OPT_FAST); void tcaselect(uint8_t i2c_bus) { if (i2c_bus > 7) return; Wire.beginTransmission(MUX_Address); Wire.write(1 << i2c_bus); Wire.endTransmission(); } /* paste code snippets from the reference documentation here */ /*--------------------------------------------------------------------------------*/ void onIfeiRpmLChange(char* newValue) { /* your code here */ RpmL = newValue; } DcsBios::StringBuffer<2> ifeiRpmLBuffer(0x7494, onIfeiRpmLChange); I tried your code (or something similar to it) in both where I have RpmL = and StringBuffer<#> with no luck. My Simpit Progress and Update Learn how to build a SimPit like mine: Follow my Blog here! Link to comment Share on other sites More sharing options...
No1sonuk Posted June 12, 2020 Share Posted June 12, 2020 Thanks No1sonuk... this totally makes sense. however, regardless of where I put this I'm getting an exit status 1 "expected primary-expression before 'if'. Not sure. That error is sometimes caused by a missing ";". DcsBios::StringBuffer<2> ifeiRpmLBuffer(0x7494, onIfeiRpmLChange); I tried your code (or something similar to it) in both where I have RpmL = and StringBuffer<#> with no luck. Can those stringbuffer numbers be changed on the fly? That's outside a "void" function, so I don't think it can. Link to comment Share on other sites More sharing options...
lesthegrngo Posted June 12, 2020 Share Posted June 12, 2020 Can you post the whole sketch, maybe we can see where the error is. The number of times I have had that or the ' XXX was not defined' errors....... Les Link to comment Share on other sites More sharing options...
No1sonuk Posted June 12, 2020 Share Posted June 12, 2020 I've just had a look at the F18 in Chuck's guides. Why do you need more than 2 digits? That's all that's on the panel. Link to comment Share on other sites More sharing options...
Guppy Posted June 12, 2020 Share Posted June 12, 2020 I've just had a look at the F18 in Chuck's guides. Why do you need more than 2 digits? That's all that's on the panel. 100 is a legitimate value for the IFEI. I just tested it in F18. My Simpit Progress and Update Learn how to build a SimPit like mine: Follow my Blog here! Link to comment Share on other sites More sharing options...
Guppy Posted June 12, 2020 Share Posted June 12, 2020 Can you post the whole sketch, maybe we can see where the error is. The number of times I have had that or the ' XXX was not defined' errors....... Les This is the working sketch I have. Please know that I have placeholders for Max, Int and BINGO but removed the DCSBIOS code for them to make troubleshooting easier. The base of this code is from dracosb who has shared his code on the forum before. /* 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 MUX_Address 0x70 // TCA9548A Address #define DCSBIOS_IRQ_SERIAL #include "Wire.h" #include <U8glib.h> #include "DcsBios.h" const u8g_fntpgm_uint8_t Tahoma_DCS_18[2310] U8G_FONT_SECTION("Tahoma_DCS_18") = { //start of font 0,24,28,0,251,18,4,37,8,230,33,97,0,19,251,19, 251,2,18,18,8,3,0,192,192,192,192,192,192,192,192,192, 192,192,192,192,0,0,0,192,192,6,7,7,10,1,12,204, 204,204,204,204,204,204,15,18,36,17,1,0,3,24,3,24, 7,48,6,48,6,48,63,254,63,254,12,96,12,96,12,96, 12,96,255,248,255,248,24,192,24,192,25,192,49,128,49,128, 11,22,44,13,1,252,4,0,4,0,4,0,31,128,127,192, 228,64,196,0,196,0,228,0,124,0,63,128,7,192,4,96, 4,96,4,96,196,192,255,192,127,0,4,0,4,0,4,0, 4,0,21,18,54,23,1,0,60,3,0,126,6,0,231,6, 0,195,12,0,195,12,0,195,24,0,195,24,0,231,48,0, 126,49,224,60,99,240,0,103,56,0,198,24,0,198,24,1, 134,24,1,134,24,3,7,56,3,3,240,6,1,224,15,18, 36,16,1,0,31,0,63,128,113,192,96,192,96,192,96,192, 49,128,31,24,30,24,119,24,99,152,193,216,192,240,192,112, 192,56,112,252,127,206,31,6,2,7,7,5,1,12,192,192, 192,192,192,192,192,7,24,24,9,1,251,14,28,24,48,48, 96,96,224,192,192,192,192,192,192,192,192,224,96,96,48,48, 24,28,14,7,24,24,9,1,251,224,112,48,24,24,12,12, 14,6,6,6,6,6,6,6,6,14,12,12,24,24,48,112, 224,10,11,22,13,2,8,12,0,12,0,140,64,237,192,63, 0,12,0,63,0,237,192,140,64,12,0,12,0,14,14,28, 17,2,1,3,0,3,0,3,0,3,0,3,0,3,0,255, 252,255,252,3,0,3,0,3,0,3,0,3,0,3,0,5, 8,8,7,1,251,56,48,112,112,96,96,192,192,7,2,2, 9,1,7,254,254,3,3,3,7,2,0,224,224,224,9,23, 46,9,0,252,1,128,1,128,3,0,3,0,3,0,6,0, 6,0,6,0,12,0,12,0,12,0,28,0,24,0,24,0, 24,0,48,0,48,0,48,0,96,0,96,0,96,0,192,0, 192,0,11,18,36,13,1,0,31,0,63,128,113,192,96,192, 192,96,192,96,192,96,192,96,192,96,192,96,192,96,192,96, 192,96,192,96,96,192,113,192,63,128,31,0,8,18,18,13, 3,0,24,24,248,248,24,24,24,24,24,24,24,24,24,24, 24,24,255,255,11,18,36,13,1,0,62,0,255,128,225,128, 128,192,0,192,0,192,0,192,1,192,1,128,3,0,7,0, 14,0,28,0,56,0,112,0,224,0,255,224,255,224,11,18, 36,13,1,0,63,0,255,192,224,224,128,96,0,96,0,96, 1,192,15,128,15,0,0,192,0,96,0,96,0,96,0,96, 128,224,225,192,255,128,63,0,12,18,36,13,0,0,0,192, 1,192,3,192,6,192,12,192,24,192,56,192,48,192,96,192, 192,192,255,240,255,240,0,192,0,192,0,192,0,192,0,192, 0,192,10,18,36,13,1,0,127,192,127,192,96,0,96,0, 96,0,96,0,96,0,126,0,127,128,1,128,0,192,0,192, 0,192,0,192,1,192,195,128,255,0,126,0,11,18,36,13, 1,0,7,192,31,192,56,0,112,0,96,0,96,0,192,0, 223,0,255,192,224,192,192,96,192,96,192,96,192,96,96,96, 112,192,63,128,31,0,11,18,36,13,1,0,255,224,255,224, 0,96,0,224,0,192,1,128,1,128,3,0,3,0,6,0, 6,0,12,0,12,0,24,0,24,0,48,0,48,0,96,0, 11,18,36,13,1,0,31,0,127,192,96,224,192,96,192,96, 192,96,224,192,121,128,31,0,103,128,96,192,192,96,192,96, 192,96,224,96,112,192,127,128,31,0,11,18,36,13,1,0, 31,0,63,128,97,192,192,192,192,96,192,96,192,96,192,96, 96,224,127,224,31,96,0,96,0,192,0,192,1,192,3,128, 63,0,62,0,3,13,13,8,3,0,224,224,224,0,0,0, 0,0,0,0,224,224,224,5,18,18,8,2,251,112,112,112, 0,0,0,0,0,0,0,56,48,112,112,96,96,192,192,13, 13,26,17,2,1,0,8,0,56,1,240,7,192,30,0,120, 0,224,0,120,0,30,0,7,192,1,240,0,56,0,8,13, 7,14,17,2,4,255,248,255,248,0,0,0,0,0,0,255, 248,255,248,13,13,26,17,3,1,128,0,224,0,124,0,31, 0,3,192,0,240,0,56,0,240,3,192,31,0,124,0,224, 0,128,0,9,18,36,11,1,0,126,0,255,0,131,128,1, 128,1,128,1,128,1,128,3,0,7,0,14,0,28,0,24, 0,24,0,24,0,0,0,0,0,24,0,24,0,9,9,18, 11,1,9,62,0,127,0,227,128,193,128,193,128,193,128,227, 128,127,0,62,0,14,18,36,14,0,0,7,128,7,128,7, 128,4,128,12,192,12,192,12,192,24,96,24,96,24,96,48, 48,63,240,63,240,96,24,96,24,96,24,224,28,192,12,11, 18,36,14,2,0,255,0,255,128,193,192,192,192,192,192,192, 192,193,128,255,0,255,128,192,192,192,96,192,96,192,96,192, 96,192,224,193,192,255,128,255,0,12,18,36,14,1,0,15, 192,31,240,56,48,112,16,96,0,224,0,192,0,192,0,192, 0,192,0,192,0,192,0,224,0,96,0,112,16,56,48,31, 240,15,192,13,18,36,16,2,0,255,0,255,192,193,224,192, 112,192,48,192,56,192,24,192,24,192,24,192,24,192,24,192, 24,192,48,192,48,192,112,193,224,255,192,255,0,10,18,36, 13,2,0,255,192,255,192,192,0,192,0,192,0,192,0,192, 0,255,128,255,128,192,0,192,0,192,0,192,0,192,0,192, 0,192,0,255,192,255,192,11,18,36,13,2,0,255,224,255, 224,192,0,192,0,192,0,192,0,192,0,255,224,255,224,192, 0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192, 0,14,18,36,16,1,0,7,240,31,252,56,28,112,4,96, 0,224,0,192,0,192,0,192,0,192,252,192,252,192,12,224, 12,96,12,112,12,60,12,31,252,7,224,12,18,36,16,2, 0,192,48,192,48,192,48,192,48,192,48,192,48,192,48,255, 240,255,240,192,48,192,48,192,48,192,48,192,48,192,48,192, 48,192,48,192,48,6,18,18,9,1,0,252,252,48,48,48, 48,48,48,48,48,48,48,48,48,48,48,252,252,8,18,18, 10,0,0,63,63,3,3,3,3,3,3,3,3,3,3,3, 3,3,135,254,252,12,18,36,14,2,0,192,112,192,224,193, 192,195,128,199,0,198,0,204,0,216,0,248,0,252,0,206, 0,198,0,195,0,195,128,193,128,192,192,192,224,192,112,10, 18,36,12,2,0,192,0,192,0,192,0,192,0,192,0,192, 0,192,0,192,0,192,0,192,0,192,0,192,0,192,0,192, 0,192,0,192,0,255,192,255,192,15,18,36,19,2,0,224, 14,240,30,240,30,248,62,216,54,220,54,204,102,204,102,198, 198,198,198,195,134,195,134,193,6,192,6,192,6,192,6,192, 6,192,6,12,18,36,16,2,0,224,48,240,48,240,48,248, 48,216,48,220,48,204,48,206,48,198,48,199,48,195,48,195, 176,193,176,193,240,192,240,192,240,192,112,192,112,15,18,36, 17,1,0,7,192,31,240,56,56,112,28,96,12,224,14,192, 6,192,6,192,6,192,6,192,6,192,6,224,14,96,12,112, 28,56,56,31,240,7,192,11,18,36,13,2,0,255,0,255, 128,193,192,192,224,192,96,192,96,192,96,192,224,193,192,255, 128,254,0,192,0,192,0,192,0,192,0,192,0,192,0,192, 0,15,23,46,17,1,251,7,192,31,240,56,56,112,28,96, 12,224,14,192,6,192,6,192,6,192,6,192,6,192,6,224, 14,96,12,112,28,56,56,31,240,7,192,0,192,0,192,0, 96,0,126,0,62,13,18,36,15,2,0,255,0,255,192,192, 192,192,96,192,96,192,96,192,96,192,192,193,192,255,128,254, 0,195,0,195,128,193,128,192,192,192,96,192,112,192,56,11, 18,36,13,1,0,31,128,127,192,96,192,192,64,192,0,192, 0,224,0,120,0,127,0,31,192,1,224,0,96,0,96,0, 96,128,96,224,192,255,128,63,0,14,18,36,14,0,0,255, 252,255,252,3,0,3,0,3,0,3,0,3,0,3,0,3, 0,3,0,3,0,3,0,3,0,3,0,3,0,3,0,3, 0,3,0,12,18,36,16,2,0,192,48,192,48,192,48,192, 48,192,48,192,48,192,48,192,48,192,48,192,48,192,48,192, 48,192,48,192,48,224,112,112,224,63,192,31,128,14,18,36, 14,0,0,192,12,224,28,96,24,96,24,96,24,48,48,48, 48,48,48,24,96,24,96,24,96,12,192,12,192,12,192,7, 128,7,128,7,128,3,0,22,18,54,22,0,0,192,48,12, 192,120,12,96,120,24,96,120,24,96,120,24,96,204,24,48, 204,48,48,204,48,48,140,48,48,134,48,25,134,96,25,134, 96,25,2,96,9,2,64,15,3,192,15,3,192,14,1,192, 6,1,128,14,18,36,14,0,0,192,12,96,24,48,48,48, 48,24,96,12,192,12,192,7,128,3,0,3,0,7,128,12, 192,12,192,24,96,48,48,48,48,96,24,192,12,14,18,36, 14,0,0,224,28,96,24,112,56,48,48,24,96,24,224,12, 192,15,192,7,128,3,0,3,0,3,0,3,0,3,0,3, 0,3,0,3,0,3,0,11,18,36,13,1,0,255,224,255, 224,0,96,0,192,1,128,1,128,3,0,6,0,6,0,12, 0,28,0,24,0,48,0,48,0,96,0,192,0,255,224,255, 224,6,24,24,9,2,251,252,252,192,192,192,192,192,192,192, 192,192,192,192,192,192,192,192,192,192,192,192,192,252,252,8, 23,23,9,1,252,192,192,96,96,96,48,48,48,24,24,24, 28,12,12,12,6,6,6,3,3,3,1,1,6,24,24,9, 1,251,252,252,12,12,12,12,12,12,12,12,12,12,12,12, 12,12,12,12,12,12,12,12,252,252,14,9,18,17,2,9, 3,0,7,128,7,128,12,192,24,96,48,48,48,48,96,24, 192,12,13,2,4,13,0,252,255,248,255,248,5,4,4,13, 3,15,224,112,48,24,10,13,26,13,1,0,63,0,127,128, 65,192,0,192,0,192,31,192,127,192,240,192,192,192,192,192, 227,192,127,192,60,192}; //end of font char* Bingo; char* FuelMax; char* FuelInt; char* RpmL; char tmp_string[8]; U8GLIB_SSD1306_128X32 u8g(U8G_I2C_OPT_FAST); void tcaselect(uint8_t i2c_bus) { if (i2c_bus > 7) return; Wire.beginTransmission(MUX_Address); Wire.write(1 << i2c_bus); Wire.endTransmission(); } /* paste code snippets from the reference documentation here */ /*------------------------------ Bingo Display ------------------------------------*/ void onIfeiBingoChange(char* newValue) { /* your code here */ Bingo = newValue; } DcsBios::StringBuffer<5> ifeiBingoBuffer(0x7462, onIfeiBingoChange); /*--------------------------------------------------------------------------------*/ void onIfeiRpmLChange(char* newValue) { /* your code here */ RpmL = newValue; } DcsBios::StringBuffer<2> ifeiRpmLBuffer(0x7494, onIfeiRpmLChange); /*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/ void setup() { DisplayInit(); DcsBios::setup(); } void DisplayInit() { for (int i = 0; i < 7; i++) { tcaselect(i); u8g.firstPage(); do { u8g.setFont(Tahoma_DCS_18); u8g.begin(); } while ( u8g.nextPage() ); } } void loop() { DisplayFuelRpm(); DcsBios::loop(); } void DisplayFuelRpm () { tcaselect(0); u8g.firstPage(); do { u8g.drawStr(30, 30, FuelMax ); } while ( u8g.nextPage() ); tcaselect(1); u8g.firstPage(); do { u8g.drawStr(30, 30, FuelInt ); } while ( u8g.nextPage() ); tcaselect(2); u8g.firstPage(); do { u8g.drawStr(40, 30, Bingo ); } while ( u8g.nextPage() ); tcaselect(3); u8g.firstPage(); do { u8g.drawStr(30, 30, RpmL ); } while ( u8g.nextPage() ); } My Simpit Progress and Update Learn how to build a SimPit like mine: Follow my Blog here! Link to comment Share on other sites More sharing options...
Recommended Posts