Jump to content

fusion

Members
  • Posts

    21
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Of course!!! Glad I can assist in the code along with middlefart!
  2. I'm guessing this is a request to update Martin's RWR and EHSI? Try using DCS-BIOS to see if that helps. Always good to have open source stuff and non proprietary. Very helpful to all of us on here. Good idea though.
  3. I used to make FFI, DED and PFL displays using deduino. Since F-16 has come out for DCS. I've trashed BMS. It's nice playing an old game but, what is the point in playing BMS since DCS F-16 is becoming more advanced than BMS? Simply said, it is easier interfacing with DCS than BMS. I threw away the code.
  4. Can you send me the link to the display you are running so I can have an idea what we are working with? Also the pinout from the display to arduino you have.
  5. Well I guess if we bug Eagle Dynamics to help with this, they may be able to do something about it....we can be a flea on their ankles.
  6. We just need to figure out the inverted text.
  7. Seems that the Newhaven Displays and the display's you all are using are a little different. The code I posted had no issues with missing text. There was no reason to change the code for new haven displays but I can see it is needed for other than new haven displays. I have resorted to buying from American companies so I can get parts faster.
  8. Nice setup. Where did you get the ICP panel?
  9. Okay everyone thanks to @Middlefart for his main code, my wife for her expertise, helping me with this code for everyone looking for the F-16 Total Fuel gauge. All you need to do is add your code for your motors for the FWD/AFT pointers and your backlighting for your gauge. Easy and done! Hope this helps everyone!! This does work great on my seeeduino XIAO controller (DEFAULT_SERIAL only). Mega, nano, etc will work with IRQ_SERIAL. /* F-16 Total Fuel Gauge Thanks to: Middlefart (Original code), Fusion and Fusion's Wife (software engineer) Code is for the 128x32 oled i2c display. All you have to do is add your motor pins and guage backlight pins if desired. Hope this helps others! DCS-BIOS has made things far easier for DCS than software made to drive simulator components in FalconBMS. Glad to be apart of the DCS world. Matt "Fusion" G. */ //#define DCSBIOS_DEFAULT_SERIAL #define DCSBIOS_DEFAULT_SERIAL #include "DcsBios.h" #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #include "characters.h" #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 32 // OLED display height, in pixels // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) #define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); int AB; float Value1; float Value2; float Value3; float Total; unsigned long time = 0; unsigned int i = 0; //Comment for barometric pressure #define ALTIMETER int updateInterval = 100; //the number of milliseconds between updates struct scrollDigit { int digit; //The digit that is displayed int y; // The vertical position of the digit }; struct disp { Adafruit_SSD1306 display; int width; int numberOfDigits; scrollDigit digits[5]; }; //disp oled = {Adafruit_SSD1306(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET), 24, 5, {{0,0},{0,0},{0,0},{0,0},{0,0}}}; disp oled = {Adafruit_SSD1306(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET), 16, 5, {{0,0},{0,0},{0,0},{0,0},{0,0}}}; void setup() { if(!oled.display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3C for 128x32 for(;;); // Don't proceed, loop forever } DcsBios::setup(); } void UpdateDisplay() { oled.display.clearDisplay(); for (int i = 0; i < oled.numberOfDigits; i++) { printScrollingDigit(oled.digits[i].digit, oled.width, oled.digits[i].y, i + 1, &oled); } //Clear the area below the the numbers if we are using the small font if (oled.width == 16) { oled.display.fillRect(0, 30, 127, 7, BLACK); } oled.display.display(); } int YPos() { return ((oled.width + 9) * -1); } void printScrollingDigit(int digit, int width, int y, int pos, disp *oled) { int x = (width * pos) - width + pos + 30; y +=5; switch (digit) { case -1: oled->display.drawBitmap(x, y, c16_0, 16, 24, 1); oled->display.drawBitmap(x, y+25, c16_1, 16, 24, 1); break; case 1: oled->display.drawBitmap(x, y, c16_1, 16, 24, 1); oled->display.drawBitmap(x, y+25, c16_2, 16, 24, 1); break; case 2: oled->display.drawBitmap(x, y, c16_2, 16, 24, 1); oled->display.drawBitmap(x, y+25, c16_3, 16, 24, 1); break; case 3: oled->display.drawBitmap(x, y, c16_3, 16, 24, 1); oled->display.drawBitmap(x, y+25, c16_4, 16, 24, 1); break; case 4: oled->display.drawBitmap(x, y, c16_4, 16, 24, 1); oled->display.drawBitmap(x, y+25, c16_5, 16, 24, 1); break; case 5: oled->display.drawBitmap(x, y, c16_5, 16, 24, 1); oled->display.drawBitmap(x, y+25, c16_6, 16, 24, 1); break; case 6: oled->display.drawBitmap(x, y, c16_6, 16, 24, 1); oled->display.drawBitmap(x, y+25, c16_7, 16, 24, 1); break; case 7: oled->display.drawBitmap(x, y, c16_7, 16, 24, 1); oled->display.drawBitmap(x, y+25, c16_8, 16, 24, 1); break; case 8: oled->display.drawBitmap(x, y, c16_8, 16, 24, 1); oled->display.drawBitmap(x, y+25, c16_9, 16, 24, 1); break; case 9: oled->display.drawBitmap(x, y, c16_9, 16, 24, 1); oled->display.drawBitmap(x, y+25, c16_0, 16, 24, 1); break; default: if (pos < 3) { oled->display.drawBitmap(x, y, c16_0, 16, 24, 1); oled->display.drawBitmap(x, y+25, c16_1, 16, 24, 1); } else { oled->display.drawBitmap(x, y, c16_0, 16, 24, 1); oled->display.drawBitmap(x, y+25, c16_0, 16, 24, 1); } break; } } void onFueltotalizer10kChange(unsigned int newValue) { unsigned int mappedValue = newValue / 6553; unsigned int y = map(newValue, mappedValue * 6553, mappedValue * 6553 + 6553, 0, YPos()); if (mappedValue == 0) { mappedValue = -1; } #ifdef TEST Serial.println(mappedValue); #endif oled.digits[0].digit = mappedValue; oled.digits[0].y = y; } void onFueltotalizer1kChange(unsigned int newValue) { unsigned int mappedValue = newValue / 6553; unsigned int y = map(newValue, mappedValue * 6553, mappedValue * 6553 + 6553, 0, YPos()); oled.digits[1].digit = mappedValue; oled.digits[1].y = y; } void onFueltotalizer100Change(unsigned int newValue) { unsigned int mappedValue = newValue / 6553; unsigned int y = map(newValue, mappedValue * 6553, mappedValue * 6553 + 6553, 0, YPos()); oled.digits[2].digit = mappedValue; oled.digits[2].y = y; oled.digits[3].digit = 0; oled.digits[3].y = y; oled.digits[4].digit = 0; oled.digits[4].y = y; } DcsBios::IntegerBuffer fueltotalizer10kBuffer(0x44e4, 0xffff, 0, onFueltotalizer10kChange); DcsBios::IntegerBuffer fueltotalizer1kBuffer(0x44e6, 0xffff, 0, onFueltotalizer1kChange); DcsBios::IntegerBuffer fueltotalizer100Buffer(0x44e8, 0xffff, 0, onFueltotalizer100Change); void loop() { DcsBios::loop(); time = millis(); if (time % updateInterval == 0) { UpdateDisplay(); } }
  10. Funny thing is I found it...lol. I will post the F-16 Fuel Total Gauge for the display in another thread. Thanks!
  11. Can you modify this just for the oled display so I can test it and tailor it for f-16 fuel total gauge? where is the characters.h file?
  12. After doing a lot of researching and my wife's (software engineer) and whoever provided the dedf16 font....they get the credit too!
  13. Can you provide me with the make and part number/model number of your display and also what your pinout from the display to your arduino is?
  14. Same issue here. Apparently there is an update to the DCS-BIOS fork for an update to show the MARK page as well. One of the guys on discord is working through getting the DED perfected. It looks like he has all the symbols in the right place and full screen. So unfortunately we have to be a little more patient. https://github.com/DCSFlightpanels/dcs-bios
×
×
  • Create New...