Jump to content

F16 DED with SSD1322 and DCS BIOS


wiggles5289

Recommended Posts

On 8/23/2022 at 1:24 PM, mike4t5 said:

Hi sorry for the late reply. unfortunately i've never managed to get it working properly. i have the same issue as yourself. it works perfectly till you get to the list page then it gets corrupted or something. im wondering if i should just try to find the same board as was used by everyone else. 

I have just jumped back into rebuilding my code for the DED. There is a problem with code I have on the first post. The StringBuffer and dedLineXBuffer values have changed somewhere with an update, possibly from the 2.6 to 2.7 jump as there have been new pages added to the DED. As for now I will be fixing the code to make sure that it does work out of the box.

Link to comment
Share on other sites

After pulling my hair out for about 2 hours as to why my original code wasn't working, I figured out that I had wrong pointer data for each line.

//F-16 DED for DCS BIOS using 256x64 ER-OLED032-1G from BuyDisplay.com
//Final code by JohnnyChicago,a whole lotta font cred to Fusion's wife, and Wiggles5289 on the DCS Forums
//Updated for DCS 2.7 on 06SEP2022

#define DCSBIOS_IRQ_SERIAL

#include "DcsBios.h"
#include <Arduino.h>
#include <U8g2lib.h>
#include <U8glib.h>

#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif

U8G2_SSD1322_NHD_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
char* line1;
char* line2;
char* line3;
char* line4;
char* line5;

const u8g_fntpgm_uint8_t DEDfont16px[1148] U8G_FONT_SECTION("DEDfont16px") =
  "_\0\3\3\4\4\4\5\5\10\16\0\376\12\376\12\377\1\212\3\1\4_ \5\0\10\61!\14\224\32"
  "q$\207\212H,\222\0\42\10\66y\61DL\2#\22\227\31q\224$\222\213\222D$\221\134\224$"
  "\22\0$\20\326\371\260\204\62\212\210\252\225$\241\11E\0%\24\270\10q\206\22\231D\22\232Hu\31"
  "E\324$\302\11\0&\21\227\31qf\22\221D\66\223JL\22\221h\42'\6\62{\61\14(\15\264"
  "\372\260$\42\211H\67\221L\0)\15\264\372\60d\42\231H\27\221D\4*\20\310\10\61~\60\205h"
  "s\300\214\24:<\20+\12V\71\261\204\42\223P\4,\10C\373\60,\24\0-\6\26Y\61\14."
  "\6#\33\61\14/\16\246\11\61\325\204\62\241L(\23\12\1\60\16\226\32q(\42JS\245B\222P"
  "\0\61\11\225\31\361D\207\230>\62\14\226\31q(\42\222P\246\243\1\63\17\226\31q(\42\222P\64"
  "%\221$\24\0\64\20\227\31q\244*\42\211H\242$\71J%\0\65\15\226\31\61\16A\305\252P&"
  "!\1\66\15\226\31\261fj\25\21'\11\5\0\67\15\226\31\61\214\62\241L(\23\252\1\70\20\226\31"
  "q(\42REB\221\224H\22\12\0\71\15\226\31q(\42N\222\232\332\10\0:\10s\33\61\354 "
  "\3;\12\223\373\60\354 \13\5\0<\11\226\31\61e\272\352\0=\7\66I\61\314\6>\11\226\31\61"
  "\244\272\351\10\77\16\226\31q(\42\222LQ\16\23\212\0@\17\230\30q,B&\213\204\42!\331\1"
  "\7A\14\226\31\261d\24\21\323a\304$B\14\226\31\61*\42\246\213\210\351\2C\15\226\31q(\42"
  "FM$\11\5\0D\14\226\31\61H\22%\276HH\0E\14\226\31\61\16A\305\212P\321\0F\14"
  "\226\31\61\16A\305\212P#\0G\14\226\31q(\42F\225\22IRH\13\226\31\61D\234\16#N"
  "\2I\11\224\32\61(\42}!J\13\226\31\61\365H\42I(\0K\15\226\31\61D,ZH\22\235"
  "H\2L\11\226\31\61\204\372\321\0M\20\227\31\61d\264J%B\211P\42\64\66\1N\15\227\31\61"
  "d\264\222\205b\252\261\11O\13\226\31q(\42~\222P\0P\14\226\31\61*\42\246\213P#\0Q"
  "\14\266\371p(\42~\222\20\245\2R\14\226\31\61*\42\246\213&&\1S\14\226\31q(\42\252V"
  "\222\204\2T\11\226\31\61LB\375\4U\12\226\31\61D\374IB\1V\13\226\31\61D\374$\241\211"
  "\0W\21\227\31\61d\134\42\224\10%\242I\42\222H\0X\17\226\31\61D$\211$&\224E\224\230"
  "\4Y\14\226\31\61D\234$\64\241&\0Z\12\226\31\61\214j:\12\15[\11\304\352\60L\372'\2"
  "\134\27\230\30\61d\22ID%\42\71L\42*\21\221D&\221ID\0]\11\304\352\60H\372'\3"
  "^\11\66\231\261d\24\221\0_\7\30\350\60\16\1`\10\64\232\61F\62\1a\16\267\31\361\242\263\312"
  "\35\303\245\66\215\1b\14\226\31\61\204\302\212\210\247\13\0c\14v\31q(\42\242&\11\5\0d\12"
  "\226\31\61UN<I\12e\14v\31q(\42\322a(\245\0f\14\226\31\261(B\65\213P\33\0"
  "g\14\246\351pN<I\212\302\13\0h\13\226\31\61\204\302\212\210O\2i\13\246\31\261\204r\10Q"
  "O\6j\12\325\351\360\224i\372\315\2k\15\226\31\61\204J,\22\222D\211$l\11\226\31\61\210\372"
  "\311\0m\21w\31\61,\222\10%B\211P\42\224\10M\0n\11v\31\61*\42>\11o\11Cm"
  "qR$)\0p\14\246\351\60*\42\236.BE\0q\12\246\351pN<I\212\32r\13v\31\61"
  "D\24\233P#\0s\12v\31q\216R\252\360\2t\13\226\31q\204\62\213PW\2u\11v\31\61"
  "D|\222\24v\13v\31\61D<Ih\42\0w\21w\31\61d\224\10%B\211P\42\232$\22\0"
  "x\15v\31\61D$\11MF\21\221\4y\24\247\350pD\22\221D$\21ID\22\221\210*\24\321"
  "\0z\11v\31\61\214\62\35\15{\14\265\371\360D\62%E\65E\1|\7\302\353\60>\14}\15\265"
  "\372\60\204\62E%\65%\31\0~\12\70xqf\23\311l\2\0\0\0\4\377\377\0";


void onDedLine1Change(char* newValue) {
  line1 = newValue;
}
DcsBios::StringBuffer<29> dedLine1Buffer(0x450a, onDedLine1Change);

void onDedLine2Change(char* newValue) {
  line2 = newValue;
}
DcsBios::StringBuffer<29> dedLine2Buffer(0x4528, onDedLine2Change);

void onDedLine3Change(char* newValue) {
  line3 = newValue;
}
DcsBios::StringBuffer<29> dedLine3Buffer(0x4546, onDedLine3Change);

void onDedLine4Change(char* newValue) {
  line4 = newValue;
}
DcsBios::StringBuffer<29> dedLine4Buffer(0x4564, onDedLine4Change);

void onDedLine5Change(char* newValue) {
  line5 = newValue;
}
DcsBios::StringBuffer<29> dedLine5Buffer(0x4582, onDedLine5Change);

void setup() {
  DcsBios::setup();
  u8g2.begin();
  u8g2.clearBuffer();
  u8g2.setFont(DEDfont16px);
}

void loop() {
  u8g2.firstPage();
  do {
    u8g2.drawStr(30, 12.8, line1);
    u8g2.drawStr(30, 25.6, line2);
    u8g2.drawStr(30, 38.4, line3);
    u8g2.drawStr(30, 51.2, line4);
    u8g2.drawStr(30, 64, line5);
  } while ( u8g2.nextPage() );
  u8g2.updateDisplay();
  DcsBios::loop(); 
}

Updated code to be added to first post.

Link to comment
Share on other sites

  • 4 weeks later...
On 8/9/2022 at 11:04 PM, Meringdal said:

A small update from me:
As mentioned above I had some troubles with this 3.12" oled display from Aliexpress - Ver: 2.1.

At first boot it worked like a charm, but changing to "List" or any other page on the DED made the display go black. Looked like there were some kind of issue where some of the letters or numbers did not fit into the panel (tried to record it in slow motion from my phone).

I deleted the font in the code, and added the standard font from the library. Now, everything works expect there is some minor bugs with some of the letters like degrees on NAV page. 

Will update this post if I find any suitable font for this display.

 

Short update:

Did not find any solution on the font, but found out that this Ver 2.1 SSD1332 display has an active area of that is smaller than the one from Buydisplay. Anyone got any input?

 

Right some good news I've managed to work it with the Ver 2.1 board, I've managed to get it up and running and the list page works only thing is it has a random a on each line don't know why but it's working! So I used wiggles5289 latest script but had to change the pointers again as on current beta it's now

Line 1 : 0x4500

Line 2 : 0x451e

Line 3 : 0x453c

Line 4 : 0x455a

Line 5 : 0x4578 

Everything else is left the same. Also one thing I did that seems to have sorted it out was move ground to pin 1 on the display. After doing that it works almost perfectly, destination page doesn't work although it might be a DC's bios and latest beta thing as it shows nothing when you inspect the output. Selecting this page will require you to reset the Arduino. External reset switch is recommended if you make the case for it. 

 

20221004_170444.jpg

20221004_170418.jpg


Edited by mike4t5
Link to comment
Share on other sites

  • 1 month later...
On 10/4/2022 at 12:34 PM, mike4t5 said:

Right some good news I've managed to work it with the Ver 2.1 board, I've managed to get it up and running and the list page works only thing is it has a random a on each line don't know why but it's working! So I used wiggles5289 latest script but had to change the pointers again as on current beta it's now

Line 1 : 0x4500

Line 2 : 0x451e

Line 3 : 0x453c

Line 4 : 0x455a

Line 5 : 0x4578 

Everything else is left the same. Also one thing I did that seems to have sorted it out was move ground to pin 1 on the display. After doing that it works almost perfectly, destination page doesn't work although it might be a DC's bios and latest beta thing as it shows nothing when you inspect the output. Selecting this page will require you to reset the Arduino. External reset switch is recommended if you make the case for it. 

 

20221004_170444.jpg

20221004_170418.jpg

 

That random A is actually some code to invert the text of certain characters. Im not a good programmer and don't know how to implement it. The U8G2 library isn't the best to do this with, Im trying to look into a temp fix to prevent the character from showing and properly highlighting the text in the future.

Link to comment
Share on other sites

  • 2 months later...
Il 9/11/2022 at 19:09, wiggles5289 ha scritto:

That random A is actually some code to invert the text of certain characters. Im not a good programmer and don't know how to implement it. The U8G2 library isn't the best to do this with, Im trying to look into a temp fix to prevent the character from showing and properly highlighting the text in the future.

It is not a random char at the end of the record there are 4 bitmaps byte each bit it is the corresponding column position char status if is 0 in normal if is 1 it is in reverse thi is the best solution i find to do that with a small record increasing and without to change to much in DCS-BIOS lua side ...
i'm agree with @RafaPolit reverse field are very usefull to understand that you are input field and when blinking that something is wrong


Edited by Ares63
Link to comment
Share on other sites

  • 4 weeks later...

Need help cant get the code to board 

got the Arduino Nano 33 BLEimage.jpeg

And the 3.12 OLED SPI ver 1.0image.jpeg

Seven pins  

got it connecten to Arduine COM port 4 for code but got error 

C:\Users\John_\Desktop\F-16_ICP__UFC__5237602\ded-main\ded-main\DED\DED.ino:62:10: fatal error: er_oled.h: No such file or directory
 #include "er_oled.h"
          ^~~~~~~~~~~
compilation terminated.
Multiple libraries were found for "DcsBios.h"
  Used: C:\Users\John_\Documents\Arduino\libraries\dcs-bios-arduino-library-0.3.8
  Not used: C:\Users\John_\Documents\Arduino\libraries\dcs-bios-arduino-library-0.2.11
exit status 1

Compilation error: er_oled.h: No such file or directory

 

this is the total code  ???

 

/*   DED v1.15 Implemented interrupt method to switch mode.
 *   DED v1.1 Added antenna symbols that replace the radio channels during radio operation in F-18 mode.
 *   Changed LIST and MISC detection method as just checking the first row wasn't robust enough.
 *  DED v1.0 Created by James Storey in May 2022, github.com/jg-storey/ded
 *  Arduino code to display F-16 Data Entry Display and F-18 Upfront Controls information from DCS-BIOS
 *  on a ER-OLEDM028-1 2.8" 256x64 OLED display from BuyDisplay.com
 *  Tested with DCS-BIOS v0.10.0
 *  
 *  A toggle switch (i.e. not a pushbutton) wired between pin D2 and GND allows the user to select between the F-16 and F-18 modes.
 *  If a switch is not connected, the mode defaults to the F-16.
 *  The selected mode activates after disconnecting and connecting to the Arduino in the DCS-BIOS Hub, or by resetting the Arduino.
 *  There is probably a better way to change modes using an interrupt.
 *  
 *  The F-18 display also includes a fuel reading and a master arm indicator.
 *  There is still some space to add other items in both modes.
 *  
 *  Known issues. The DEST page in the LIST menu comes up blank. This appears to be an issue with DCS-BIOS.
 *  When entering data between the highlighted asterisks the field does not highlight. I haven't figured out an efficient way to do this yet.
 */
 
/*
  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"
 
/***************************************************
EastRising Technology Co.,LTD
Examples for ER-OLEDM28-1
Display is Hardward SPI 4-Wire SPI Interface
Tested and worked with:
Works with Arduino 1.6.0 IDE  
Test OK : Arduino DUE,Arduino mega2560,Arduino UNO Board
****************************************************/
 
/*
 Note:The module needs to be jumpered to an SPI interface. R19,R23 Short and R18,R20 Open  
 Unused signal pin Recommended to connect to GND
  == Hardware connection ==
    OLED   =>    Arduino
  *1. GND    ->    GND
  *2. VCC    ->    3.3
  *4. SCL    ->    SCK (D13)
  *5. SDI    ->    MOSI (D11)
  *14. DC     ->    D9
  *15. RES    ->    D8  
  *16. CS     ->    D10
*/


 
#include "er_oled.h"
 
volatile boolean f16 = true; // flag to display F-16 DED
volatile boolean f18 = false; // flag to display F-18 UFC
//boolean isList = false; //flag to indicate if we are on the LIST or MISC DED pages
 
const int buttonPin = 2; //Toggle switch to change modes
//variables to keep track of the timing of recent interrupts
unsigned long button_time = 0;
unsigned long last_button_time = 0;
 
//F-16 DCS BIOS Functions
 
void onDedLine1Change(char* newValue) {
    /* your code here */
    if(f16){
     
      er_oled_dedstring(0,0,newValue,0);
    }
}
DcsBios::StringBuffer<29> dedLine1Buffer(0x4500, onDedLine1Change);
 
void onDedLine2Change(char* newValue) {
    /* your code here */
    if(f16){
      er_oled_dedstring(0,13,newValue,0);
     
      //Highlight numbers if we are on the LIST or MISC pages
      if(newValue[0]=='1' && (newValue[1]=='D' || newValue[1]=='C')){
        //Highlight the menu numbers
        er_oled_string(0,13,"1",1);
        er_oled_string(6*8,13,"2",1);
        er_oled_string(12*8,13,"3",1);
        er_oled_string(18*8,13,"R",1);
      }
    }  
}
DcsBios::StringBuffer<29> dedLine2Buffer(0x451e, onDedLine2Change);
 
void onDedLine3Change(char* newValue) {
    /* your code here */
    if(f16){
      er_oled_dedstring(0,26,newValue,0);
     
      if(newValue[0]=='4' && (newValue[1]=='N' || newValue[1]=='I')){
        er_oled_string(0,26,"4",1);
        er_oled_string(6*8,26,"5",1);
        er_oled_string(12*8,26,"6",1);
        er_oled_string(18*8,26,"E",1);
      }
    }  
}
DcsBios::StringBuffer<29> dedLine3Buffer(0x453c, onDedLine3Change);
 
void onDedLine4Change(char* newValue) {
    /* your code here */
    if(f16){
      er_oled_dedstring(0,39,newValue,0);  
     
      if(newValue[0]=='7' && (newValue[1]=='C' || newValue[1]=='D')){
        er_oled_string(0,39,"7",1);
        er_oled_string(6*8,39,"8",1);
        er_oled_string(12*8,39,"9",1);
        er_oled_string(18*8,39,"0",1);
      }
    }
}
DcsBios::StringBuffer<29> dedLine4Buffer(0x455a, onDedLine4Change);
 
void onDedLine5Change(char* newValue) {
    /* your code here */
    if(f16){
      er_oled_dedstring(0,52,newValue,0);
    }  
}
DcsBios::StringBuffer<29> dedLine5Buffer(0x4578, onDedLine5Change);



 
// F-18 DCS BIOS Functions
void onUfcComm1DisplayChange(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(0*8,52,newValue,0);
    }
}
DcsBios::StringBuffer<2> ufcComm1DisplayBuffer(0x7424, onUfcComm1DisplayChange);
 
void onUfcComm2DisplayChange(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(5*8,52,newValue,0);
    }
}
DcsBios::StringBuffer<2> ufcComm2DisplayBuffer(0x7426, onUfcComm2DisplayChange);
 
void onUfcOptionCueing1Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(12*8,0,newValue,0);
    }  
}
DcsBios::StringBuffer<1> ufcOptionCueing1Buffer(0x7428, onUfcOptionCueing1Change);
 
void onUfcOptionCueing2Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(12*8,13,newValue,0);
    }
}
DcsBios::StringBuffer<1> ufcOptionCueing2Buffer(0x742a, onUfcOptionCueing2Change);
 
void onUfcOptionCueing3Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(12*8,26,newValue,0);
    }  
}
DcsBios::StringBuffer<1> ufcOptionCueing3Buffer(0x742c, onUfcOptionCueing3Change);
 
void onUfcOptionCueing4Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(12*8,39,newValue,0);
    }
}
DcsBios::StringBuffer<1> ufcOptionCueing4Buffer(0x742e, onUfcOptionCueing4Change);
 
void onUfcOptionCueing5Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(12*8,52,newValue,0);
    }
}
DcsBios::StringBuffer<1> ufcOptionCueing5Buffer(0x7430, onUfcOptionCueing5Change);
 
void onUfcOptionDisplay1Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(13*8,0,newValue,0);
    }
}
DcsBios::StringBuffer<4> ufcOptionDisplay1Buffer(0x7432, onUfcOptionDisplay1Change);
 
void onUfcOptionDisplay2Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(13*8,13,newValue,0);
    }
}
DcsBios::StringBuffer<4> ufcOptionDisplay2Buffer(0x7436, onUfcOptionDisplay2Change);
 
void onUfcOptionDisplay3Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(13*8,26,newValue,0);
    }
}
DcsBios::StringBuffer<4> ufcOptionDisplay3Buffer(0x743a, onUfcOptionDisplay3Change);
 
void onUfcOptionDisplay4Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(13*8,39,newValue,0);
    }
}
DcsBios::StringBuffer<4> ufcOptionDisplay4Buffer(0x743e, onUfcOptionDisplay4Change);
 
void onUfcOptionDisplay5Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(13*8,52,newValue,0);
    }
}
DcsBios::StringBuffer<4> ufcOptionDisplay5Buffer(0x7442, onUfcOptionDisplay5Change);
 
void onUfcScratchpadNumberDisplayChange(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(3*8,0,newValue,0);
    }
}
DcsBios::StringBuffer<8> ufcScratchpadNumberDisplayBuffer(0x7446, onUfcScratchpadNumberDisplayChange);


 
void onUfcScratchpadString1DisplayChange(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(0*8,0,newValue,0);
    }
}
DcsBios::StringBuffer<2> ufcScratchpadString1DisplayBuffer(0x744e, onUfcScratchpadString1DisplayChange);
 
void onUfcScratchpadString2DisplayChange(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(2*8,0,newValue,0);
    }
}
DcsBios::StringBuffer<2> ufcScratchpadString2DisplayBuffer(0x7450, onUfcScratchpadString2DisplayChange);
 
void onIfeiFuelUpChange(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(20*8,26,newValue,0);
    }
}
DcsBios::StringBuffer<6> ifeiFuelUpBuffer(0x748a, onIfeiFuelUpChange);
 
void onMasterModeAaLtChange(unsigned int newValue) {
    /* your code here */
}
DcsBios::IntegerBuffer masterModeAaLtBuffer(0x740c, 0x0200, 9, onMasterModeAaLtChange);
 
void onMasterArmSwChange(unsigned int newValue) {
    /* your code here */
    if(f18){
      if(newValue){
      er_oled_string(20*8,0," ARM ",1);
    }else{
      er_oled_string(20*8,0," SAFE ",0);
    }
  }
}
DcsBios::IntegerBuffer masterArmSwBuffer(0x740c, 0x2000, 13, onMasterArmSwChange);
 
void splashScreen(){
  er_oled_clear();
  er_oled_string(12*8,13,"DED V1.15",1);
  er_oled_string(4*8,26,"GITHUB.COM/JG-STOREY/DED",0);
  if(f16){
    er_oled_string(11*8,52,"F-16 MODE",0);
  }
  else if(f18){
    er_oled_string(11*8,52,"F/A-18 MODE",0);
  }
 
 
}
 
void button_ISR(){
  button_time = millis();
  //check to see if increment() was called in the last 250 milliseconds
  if (button_time - last_button_time > 250){
    f16 = digitalRead(buttonPin);
    f18 = !f16;
    splashScreen();
    er_oled_clear();
    last_button_time = button_time;
  }
}
 
void setup() {
 
  //set D2 as a switch to select F-16 or F-18 displays. If unconnected it defaults to F-16.
  pinMode(buttonPin, INPUT_PULLUP);
  f16 = digitalRead(buttonPin);
  f18 = !f16;
  /* initialize the display */
  er_oled_begin();
  splashScreen();
  delay(2000);
  er_oled_clear();
  attachInterrupt(digitalPinToInterrupt(buttonPin), button_ISR, CHANGE);  
 
  DcsBios::setup();
 
}
 
void loop() {
 
DcsBios::loop();
 
}

null

pins connected like in code 

please can some one help i dont know anything programming with arduino ??

or can some one write me a code that works ???

 

Link to comment
Share on other sites

5 hours ago, Mverick1971 said:

Need help cant get the code to board 

got the Arduino Nano 33 BLEimage.jpeg

And the 3.12 OLED SPI ver 1.0image.jpeg

Seven pins  

got it connecten to Arduine COM port 4 for code but got error 

C:\Users\John_\Desktop\F-16_ICP__UFC__5237602\ded-main\ded-main\DED\DED.ino:62:10: fatal error: er_oled.h: No such file or directory
 #include "er_oled.h"
          ^~~~~~~~~~~
compilation terminated.
Multiple libraries were found for "DcsBios.h"
  Used: C:\Users\John_\Documents\Arduino\libraries\dcs-bios-arduino-library-0.3.8
  Not used: C:\Users\John_\Documents\Arduino\libraries\dcs-bios-arduino-library-0.2.11
exit status 1

Compilation error: er_oled.h: No such file or directory

 

this is the total code  ???

 

/*   DED v1.15 Implemented interrupt method to switch mode.
 *   DED v1.1 Added antenna symbols that replace the radio channels during radio operation in F-18 mode.
 *   Changed LIST and MISC detection method as just checking the first row wasn't robust enough.
 *  DED v1.0 Created by James Storey in May 2022, github.com/jg-storey/ded
 *  Arduino code to display F-16 Data Entry Display and F-18 Upfront Controls information from DCS-BIOS
 *  on a ER-OLEDM028-1 2.8" 256x64 OLED display from BuyDisplay.com
 *  Tested with DCS-BIOS v0.10.0
 *  
 *  A toggle switch (i.e. not a pushbutton) wired between pin D2 and GND allows the user to select between the F-16 and F-18 modes.
 *  If a switch is not connected, the mode defaults to the F-16.
 *  The selected mode activates after disconnecting and connecting to the Arduino in the DCS-BIOS Hub, or by resetting the Arduino.
 *  There is probably a better way to change modes using an interrupt.
 *  
 *  The F-18 display also includes a fuel reading and a master arm indicator.
 *  There is still some space to add other items in both modes.
 *  
 *  Known issues. The DEST page in the LIST menu comes up blank. This appears to be an issue with DCS-BIOS.
 *  When entering data between the highlighted asterisks the field does not highlight. I haven't figured out an efficient way to do this yet.
 */
 
/*
  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"
 
/***************************************************
EastRising Technology Co.,LTD
Examples for ER-OLEDM28-1
Display is Hardward SPI 4-Wire SPI Interface
Tested and worked with:
Works with Arduino 1.6.0 IDE  
Test OK : Arduino DUE,Arduino mega2560,Arduino UNO Board
****************************************************/
 
/*
 Note:The module needs to be jumpered to an SPI interface. R19,R23 Short and R18,R20 Open  
 Unused signal pin Recommended to connect to GND
  == Hardware connection ==
    OLED   =>    Arduino
  *1. GND    ->    GND
  *2. VCC    ->    3.3
  *4. SCL    ->    SCK (D13)
  *5. SDI    ->    MOSI (D11)
  *14. DC     ->    D9
  *15. RES    ->    D8  
  *16. CS     ->    D10
*/


 
#include "er_oled.h"
 
volatile boolean f16 = true; // flag to display F-16 DED
volatile boolean f18 = false; // flag to display F-18 UFC
//boolean isList = false; //flag to indicate if we are on the LIST or MISC DED pages
 
const int buttonPin = 2; //Toggle switch to change modes
//variables to keep track of the timing of recent interrupts
unsigned long button_time = 0;
unsigned long last_button_time = 0;
 
//F-16 DCS BIOS Functions
 
void onDedLine1Change(char* newValue) {
    /* your code here */
    if(f16){
     
      er_oled_dedstring(0,0,newValue,0);
    }
}
DcsBios::StringBuffer<29> dedLine1Buffer(0x4500, onDedLine1Change);
 
void onDedLine2Change(char* newValue) {
    /* your code here */
    if(f16){
      er_oled_dedstring(0,13,newValue,0);
     
      //Highlight numbers if we are on the LIST or MISC pages
      if(newValue[0]=='1' && (newValue[1]=='D' || newValue[1]=='C')){
        //Highlight the menu numbers
        er_oled_string(0,13,"1",1);
        er_oled_string(6*8,13,"2",1);
        er_oled_string(12*8,13,"3",1);
        er_oled_string(18*8,13,"R",1);
      }
    }  
}
DcsBios::StringBuffer<29> dedLine2Buffer(0x451e, onDedLine2Change);
 
void onDedLine3Change(char* newValue) {
    /* your code here */
    if(f16){
      er_oled_dedstring(0,26,newValue,0);
     
      if(newValue[0]=='4' && (newValue[1]=='N' || newValue[1]=='I')){
        er_oled_string(0,26,"4",1);
        er_oled_string(6*8,26,"5",1);
        er_oled_string(12*8,26,"6",1);
        er_oled_string(18*8,26,"E",1);
      }
    }  
}
DcsBios::StringBuffer<29> dedLine3Buffer(0x453c, onDedLine3Change);
 
void onDedLine4Change(char* newValue) {
    /* your code here */
    if(f16){
      er_oled_dedstring(0,39,newValue,0);  
     
      if(newValue[0]=='7' && (newValue[1]=='C' || newValue[1]=='D')){
        er_oled_string(0,39,"7",1);
        er_oled_string(6*8,39,"8",1);
        er_oled_string(12*8,39,"9",1);
        er_oled_string(18*8,39,"0",1);
      }
    }
}
DcsBios::StringBuffer<29> dedLine4Buffer(0x455a, onDedLine4Change);
 
void onDedLine5Change(char* newValue) {
    /* your code here */
    if(f16){
      er_oled_dedstring(0,52,newValue,0);
    }  
}
DcsBios::StringBuffer<29> dedLine5Buffer(0x4578, onDedLine5Change);



 
// F-18 DCS BIOS Functions
void onUfcComm1DisplayChange(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(0*8,52,newValue,0);
    }
}
DcsBios::StringBuffer<2> ufcComm1DisplayBuffer(0x7424, onUfcComm1DisplayChange);
 
void onUfcComm2DisplayChange(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(5*8,52,newValue,0);
    }
}
DcsBios::StringBuffer<2> ufcComm2DisplayBuffer(0x7426, onUfcComm2DisplayChange);
 
void onUfcOptionCueing1Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(12*8,0,newValue,0);
    }  
}
DcsBios::StringBuffer<1> ufcOptionCueing1Buffer(0x7428, onUfcOptionCueing1Change);
 
void onUfcOptionCueing2Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(12*8,13,newValue,0);
    }
}
DcsBios::StringBuffer<1> ufcOptionCueing2Buffer(0x742a, onUfcOptionCueing2Change);
 
void onUfcOptionCueing3Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(12*8,26,newValue,0);
    }  
}
DcsBios::StringBuffer<1> ufcOptionCueing3Buffer(0x742c, onUfcOptionCueing3Change);
 
void onUfcOptionCueing4Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(12*8,39,newValue,0);
    }
}
DcsBios::StringBuffer<1> ufcOptionCueing4Buffer(0x742e, onUfcOptionCueing4Change);
 
void onUfcOptionCueing5Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(12*8,52,newValue,0);
    }
}
DcsBios::StringBuffer<1> ufcOptionCueing5Buffer(0x7430, onUfcOptionCueing5Change);
 
void onUfcOptionDisplay1Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(13*8,0,newValue,0);
    }
}
DcsBios::StringBuffer<4> ufcOptionDisplay1Buffer(0x7432, onUfcOptionDisplay1Change);
 
void onUfcOptionDisplay2Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(13*8,13,newValue,0);
    }
}
DcsBios::StringBuffer<4> ufcOptionDisplay2Buffer(0x7436, onUfcOptionDisplay2Change);
 
void onUfcOptionDisplay3Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(13*8,26,newValue,0);
    }
}
DcsBios::StringBuffer<4> ufcOptionDisplay3Buffer(0x743a, onUfcOptionDisplay3Change);
 
void onUfcOptionDisplay4Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(13*8,39,newValue,0);
    }
}
DcsBios::StringBuffer<4> ufcOptionDisplay4Buffer(0x743e, onUfcOptionDisplay4Change);
 
void onUfcOptionDisplay5Change(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(13*8,52,newValue,0);
    }
}
DcsBios::StringBuffer<4> ufcOptionDisplay5Buffer(0x7442, onUfcOptionDisplay5Change);
 
void onUfcScratchpadNumberDisplayChange(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(3*8,0,newValue,0);
    }
}
DcsBios::StringBuffer<8> ufcScratchpadNumberDisplayBuffer(0x7446, onUfcScratchpadNumberDisplayChange);


 
void onUfcScratchpadString1DisplayChange(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(0*8,0,newValue,0);
    }
}
DcsBios::StringBuffer<2> ufcScratchpadString1DisplayBuffer(0x744e, onUfcScratchpadString1DisplayChange);
 
void onUfcScratchpadString2DisplayChange(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(2*8,0,newValue,0);
    }
}
DcsBios::StringBuffer<2> ufcScratchpadString2DisplayBuffer(0x7450, onUfcScratchpadString2DisplayChange);
 
void onIfeiFuelUpChange(char* newValue) {
    /* your code here */
    if(f18){
      er_oled_string(20*8,26,newValue,0);
    }
}
DcsBios::StringBuffer<6> ifeiFuelUpBuffer(0x748a, onIfeiFuelUpChange);
 
void onMasterModeAaLtChange(unsigned int newValue) {
    /* your code here */
}
DcsBios::IntegerBuffer masterModeAaLtBuffer(0x740c, 0x0200, 9, onMasterModeAaLtChange);
 
void onMasterArmSwChange(unsigned int newValue) {
    /* your code here */
    if(f18){
      if(newValue){
      er_oled_string(20*8,0," ARM ",1);
    }else{
      er_oled_string(20*8,0," SAFE ",0);
    }
  }
}
DcsBios::IntegerBuffer masterArmSwBuffer(0x740c, 0x2000, 13, onMasterArmSwChange);
 
void splashScreen(){
  er_oled_clear();
  er_oled_string(12*8,13,"DED V1.15",1);
  er_oled_string(4*8,26,"GITHUB.COM/JG-STOREY/DED",0);
  if(f16){
    er_oled_string(11*8,52,"F-16 MODE",0);
  }
  else if(f18){
    er_oled_string(11*8,52,"F/A-18 MODE",0);
  }
 
 
}
 
void button_ISR(){
  button_time = millis();
  //check to see if increment() was called in the last 250 milliseconds
  if (button_time - last_button_time > 250){
    f16 = digitalRead(buttonPin);
    f18 = !f16;
    splashScreen();
    er_oled_clear();
    last_button_time = button_time;
  }
}
 
void setup() {
 
  //set D2 as a switch to select F-16 or F-18 displays. If unconnected it defaults to F-16.
  pinMode(buttonPin, INPUT_PULLUP);
  f16 = digitalRead(buttonPin);
  f18 = !f16;
  /* initialize the display */
  er_oled_begin();
  splashScreen();
  delay(2000);
  er_oled_clear();
  attachInterrupt(digitalPinToInterrupt(buttonPin), button_ISR, CHANGE);  
 
  DcsBios::setup();
 
}
 
void loop() {
 
DcsBios::loop();
 
}

null

pins connected like in code 

please can some one help i dont know anything programming with arduino ??

or can some one write me a code that works ???

 

Thats a different DED code from my own. But from what I have seen, looks like you are missing the EROLED library. That should be included into the sketch folder from the example he provided.

Link to comment
Share on other sites

Do not use the "er_oled.h" library from East Rising, as it can only be used with their own examples.

Try to start with adafruits gfx library or use the u8g2 library for your display.

 

Regards, Vinc

 

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

I am really struggling with this. 

I use this display with an Arduino Uno: https://www.alibaba.com/product-detail/RTS-5-5-25664-256-64_62263543892.html?spm=a2700.galleryofferlist.normal_offer.d_title.6078564eiq0g8T

I have tried the code from the first post. All libs included.

Pinout like this

OLED ARDUINO
1 GND
2 3.3 V
4 D13
5 D11
14 D9
15 D8
16 D10

 

No life what so ever in the screen. I did plug it into 5V at first. Might that have damaged the screen?

 

My latest project, the Multi Function Button Box can be found at Kickstarter.

Link to comment
Share on other sites

25 minutes ago, JackFlash said:

I am really struggling with this. 

I use this display with an Arduino Uno: https://www.alibaba.com/product-detail/RTS-5-5-25664-256-64_62263543892.html?spm=a2700.galleryofferlist.normal_offer.d_title.6078564eiq0g8T

I have tried the code from the first post. All libs included.

Pinout like this

OLED ARDUINO
1 GND
2 3.3 V
4 D13
5 D11
14 D9
15 D8
16 D10

 

No life what so ever in the screen. I did plug it into 5V at first. Might that have damaged the screen?

 

I don't know what connection it is 3 or 4 spi. You must solder the jumpers depending on the connection.

Снимок экрана 2023-02-27 205808.jpg

CPU i7-4790k/ zotac GTX1080/ ОЗУ 16Gb/ Philips 40" 3840x2160/ джойстик BRD-N(v. №4) + педали BRD-F2 restyling + WW2-DVik Throttle(MMJoy2)/ TrackIR5 pro/

https://cults3d.com/ru/polzovateli/abelnaitrod/tvoreniya

Link to comment
Share on other sites

OLEDs don't have backlight. If it were a LCD you may have a chance to see anything by connecting the backlight LED pins to power.

Regards, Vinc


Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Hello,

(Electronics and coding noob here) I'm also using an ER-OLEDM032-1 connected to an Arduino Mega and using the code above. It works great but besides some formatting preferences as I want the text to cover the whole width of the screen, the refresh time when changing DED pages seems slow( like one second to load a page). Could some code tweaking bump up the refresh rate or is it a limitation of the Arduino's processing power?  

Thanks in advance!

Link to comment
Share on other sites

  • 2 weeks later...
On 3/5/2023 at 3:38 PM, Ghost117 said:

Hello,

(Electronics and coding noob here) I'm also using an ER-OLEDM032-1 connected to an Arduino Mega and using the code above. It works great but besides some formatting preferences as I want the text to cover the whole width of the screen, the refresh time when changing DED pages seems slow( like one second to load a page). Could some code tweaking bump up the refresh rate or is it a limitation of the Arduino's processing power?  

Thanks in advance!

Its a problem with how fast the code updates with the stream from the computer. Its a limitation of the Arduino coupled with a code issue. I will eventually have an update to add a refresh rate option and inverse the characters once I can grasp a method to flip the inverted text with my library.

  • Like 1
Link to comment
Share on other sites

  • 5 weeks later...

Hi JohnnyChicaco

I don't have the display but would start by connecting it to the ESP32's hardware SPI bus.

You may read out the SPI in use at the serial monitor by the loading the below code (taken from ->here<-)

Spoiler
/*
  Rui Santos
  Complete project details at https://RandomNerdTutorials.com/esp32-spi-communication-arduino/
  
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files.
  
  The above copyright notice and this permission notice shall be included in all
  copies or substantial portions of the Software.
*/

//Find the default SPI pins for your board
//Make sure you have the right board selected in Tools > Boards
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.print("MOSI: ");
  Serial.println(MOSI);
  Serial.print("MISO: ");
  Serial.println(MISO);
  Serial.print("SCK: ");
  Serial.println(SCK);
  Serial.print("SS: ");
  Serial.println(SS);  
}

void loop() {
  // put your main code here, to run repeatedly:
}

 

For me the sketch returns as follows for an 30 and 38 pin ESP32 devboard

MOSI: 23
MISO: 19
SCK: 18
SS: 5

 

No further data for your display available, I therefore used a pic found on ebay to decifer the pins D0 and D1. If that doesn't work you may flip the connections.

D0 (CLK / SCLK / SCK)
D1 (DIN / MOSI)
CS (SS)

The pins for RES (RST) and D/C (DC) have to be defined by yourself.

Connect GND and VCC as usual.

 

Regards, Vinc


Edited by Vinc_Vega
  • Thanks 1

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

yes ... success !! Oled is working with all Demo sketches.

But The F-16 DED sketch is not working :

Error

In file included from c:\Users\claud\OneDrive\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/internal/Servos.h:6,
                 from c:\Users\claud\OneDrive\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:126,
                 from C:\Users\claud\OneDrive\Documents\Arduino\F16_DED_ESP32_OLED1322\F16_DED_ESP32_OLED1322.ino:8:
C:\Users\claud\AppData\Local\Arduino15\libraries\Servo\src/Servo.h:77:2: error: #error "This library only supports boards with an AVR, SAM, SAMD, NRF52 or STM32F4 processor."
 #error "This library only supports boards with an AVR, SAM, SAMD, NRF52 or STM32F4 processor."
  ^~~~~

exit status 1

Compilation error: exit status 1

Link to comment
Share on other sites

Hi Johnny,

"Servos.h" compiling error!

As I wrote in the sketchbook repository, you have to include the AnalogWrite library for the ESP32 if you want to use it with DcsBios.

https://www.arduino.cc/reference/en/libraries/esp32-analogwrite/

 

  #define DCSBIOS_DEFAULT_SERIAL
  #include "analogWrite.h"  //to be used with the ESP32 chip   https://www.arduino.cc/reference/en/libraries/esp32-analogwrite/
  #include "DcsBios.h"

 

Regards, Vinc

  • Thanks 1

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Solved,

Under ->Preferences, Espressif Systems's esp32 Version 1.0.6 in the ->Additional Board Manager has to be used by introducing the following URL:

https://dl.espressif.com/dl/package_esp32_index.json

 

Regards, Vinc


Edited by Vinc_Vega
  • Thanks 1

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

  • 3 months later...

Update:

A while ago JohnnyChicago and me developed code, working with the ESP32 board and the U8g2lib library, running at an 256x64 pixels SH1122 display. We implemented a newly created font, compatible with the U8g2lib library and included inverted characters. So items automatically are highlighted for different menus. However, the developer mostly did not apply the inversion logic to the asterisk (*) so we decided to use only the inverted character inside the fonts file. Most of the code is commented so you may alter it if necessary.

 

Spoiler
//F-16 DED for DCS BIOS using 256x64 ER-OLED032-1G from BuyDisplay.com
//Final code by JohnnyChicago,a whole lotta font cred to Fusion's wife, and Wiggles5289 on the DCS Forums
// adapted by Vinc_Vega to work exclusively with the u8g2 library, new font with inverted chars added,
// inverted chars are original ASCII code byte + 100, interprete steering bits (bytes 26 - 29 of each DED line) and plot inverted chars,
// unfortunately at the time not all inverted chars are covered by the steering bits (mostly the inverted asterics (*) is missing and therefore is displayed always inveted)

#define DCSBIOS_DEFAULT_SERIAL
#include "analogWrite.h"  //to use the ESP32 chip with DcsBios   https://www.arduino.cc/reference/en/libraries/esp32-analogwrite/
#include "DcsBios.h"
#include <SPI.h>
#include <U8g2lib.h>

U8G2_SH1122_256X64_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 5, /* dc=*/ 21, /* reset=*/ 22);				// Enable U8G2_16BIT in u8g2.h

// ----------------------------------------------------------------------------------------
//            Declaration of the variables
// ----------------------------------------------------------------------------------------

String(line1); String(line2); String(line3); String(line4); String(line5);  // create a string object for each line to manipulate the content
const byte x = 28;         // cursor x is always 28 (first char of a line to print) for a 256x64 display
const byte y = 13;         // cursor y is according to the line number: y = (line number * y) -1) -> first line print at y = 12

// ----------------------------------------------------------------------------------------
//            costume F-16 DED font including inversed chars for the u8g2 library
// ----------------------------------------------------------------------------------------
/*
  Fontname: DEDFontNewInv_01
  Copyright: Vinc_Vega
  Glyphs: 142/195
  BBX Build Mode: 0
*/
const uint8_t u8g2_font_DEDFontNewInv[1755] U8G2_FONT_SECTION("u8g2_font_DEDFontNewInv") = 
  "\216\0\3\4\4\4\3\5\5\10\14\0\377\11\376\11\0\1h\2\315\6\276 \5\0\334\30!\7\222\207"
  "\30L\4\42\14E\255\30\42$\42AB!\0#\17\226\205\70A\261\230\4\305\213IP,\0$\5"
  "\0\334\30%\17\226\205\30c!A$br!\12\11\33&\20\226\205XC%\242b##E!&"
  "#\1'\10B\256\30$\42\0(\12\224\206X\42Er\33\22)\14\224\206\30BcB\62\225\10\1"
  "*\20\270|\30\17$%Q\310\252\221D)y(+\13f\215X\202BL\202B\0,\10B\207\30"
  "$\42\0-\6&\235\30\14.\6\42\207\30\4/\12v\215\270\201br\14\5\60\15\226\205Xb$"
  "Bt\22!\23\2\61\12\224\206XA\42CrA\62\14\226\205\70$H\202\42*\202\14\63\15\226\205"
  "\30\214bb\243D($\0\64\14\226\205\30\42\362\13\233\240\24\0\65\14\226\205\30\216%\206D($"
  "\0\66\15\226\205\70$\210%HD($\0\67\13\226\205\30\214br\224\10\0\70\16\226\205\70$H"
  "($BD($\0\71\16\226\205\70$HD(\205\42%$\0:\7b\227\30\204\4;\11\202\207"
  "\30\204$\42\0<\11\226\205\230br\225\3=\10f\215\30\354\240\14>\12\226\205\30\242r\223#\0"
  "\77\17\226\205\70$HbCc\342`\202B\0@\20\226\205\70$g\202%#!#!($\0A"
  "\15\226\205Xb$HD\17AD\2B\15\226\205\30%H'%BD-\0C\14\226\205\70$H"
  "\204\62\241\220\0D\13\226\205\30E%\362_T\0E\13\226\205\30\216DD\202\202\14F\13\226\205\30"
  "\216DD\202\62\2G\14\226\205\70$H\204\42\225P\12H\13\226\205\30B\224\36\202h\22I\11\226"
  "\205\30L\202rbJ\13\226\205\30L\202r\42\32\3K\17\226\205\30B$(DcD%\42E\2"
  "L\11\226\205\30\202\362\221\1M\13\226\205\30\201C\17At\22N\15\226\205\30aD%%$\225\250"
  "\5O\13\226\205\70$HtB!\1P\14\226\205\30%HD-\202\22\1Q\13\226\205\70$H\264"
  " \221\12R\15\226\205\30%HD'%\62\21\11S\15\226\205\70$\210E\205\202($\0T\12\226"
  "\205\30L\202\362\11\0U\13\226\205\30B\364\11\205\4\0V\16\226\205\30Bt\22\11\12\242&\4\0"
  "W\13\226\205\30Btz\10\32\14X\21\226\205\30BD\42AAdbDQ\204\210\4Y\16\226\205"
  "\30BD\42AAd\202r\2Z\11\226\205\30\214brd[\10\224\206\30JrB\134\7\222\207\30"
  "\17\3]\10\224\206\30HrR^\14U\246XaC!!\42c\1_\6\26\205\30\6`\10B\257"
  "\30$\42\0a\15\226\205Xb$\346\20M\310\204\0o\7\63\265\30$\4{\14\226\205X\202\362d"
  "B&\4\0|\7\222\207\30\17\3}\14\226\205Xb$F\202\362\4\0~\13F\225\70b$\42d"
  "\42\0\204\10\270|\30\377\320\0\205\13\270|\30K\366\344d\264\0\206\20\270|\30IACA$\42"
  "#\42\17\37\14\207\26\270|\30*\42$\42\303#\42$\42$\42\303#\42$\42\12\210\5\0\334\30"
  "\211\22\270|\30i%!\322\202\352\24&\42\22R\226\0\212\23\270|\30k\244CGe!BaB"
  "\42\303c!\11\213\14\270|\30JF'&\17\37\20\214\14\270|\30LeDv:\63R\215\14\270"
  "|\30JfGv\42+b\216\20\270|\30\17$%Q\310\252\221D)y(\217\16\270|\30\17L"
  "F\304\302DF\17\4\220\13\270|\30\77\30\31\235\230\60\221\13\270|\30\37\226\205\37\36\6\222\11\270"
  "|\30\177\70\62Z\223\14\270|\30\17'Fu\62y\70\224\15\270|\30K\205C\362O\203E\13\225"
  "\15\270|\30,FeF\66\25\22*\226\20\270|\30\212\303BBF\243\242C\306\302\11\227\15\270|"
  "\30\311\302F\325\216d\36T\230\22\270|\30IACACACA\303\302E\226\24\231\15\270|\30"
  "\311\222L\207\215d\36T\232\16\270|\30\212\303B\246\303Br\36T\233\14\270|\30\311\302Fu\262"
  "\324\0\234\17\270|\30\212\303B\222\7\207\344<\250\0\235\16\270|\30\212\303Br\36\65\32\35T\236"
  "\15\270|\30\17DF\17GF\17\14\237\16\270|\30\17DF\17GF'&\14\240\12\270|\30M"
  "u\272S\2\241\15\270|\30\17\312\302\17\303\302\17\2\242\12\270|\30Iw\252S\3\243\17\270|\30"
  "\212\303BBedENF\13\244\23\270|\30\212\303\42CFbA\42\221D\42\11\17*\245\16\270"
  "|\30K\205\303Br\226$S\2\246\16\270|\30\251\303BR'\311YT\1\247\16\270|\30\212\303"
  "B\222l\222<\250\0\250\24\270|\30\251\244CACACACACA\243\242\12\251\14\270|\30"
  "\311\222\14)Y\26N\252\14\270|\30\311\222\14)\331\324\0\253\21\270|\30\212\303B\222\214\302\204\302"
  "\204$\217&\254\14\270|\30I\362Y\222\374\224\0\255\14\270|\30\311\302Dv\42\26N\256\14\270|"
  "\30\311\302Dv\42$c\257\22\270|\30I\222\302D\7\311\12I\207\302\204\204\22\260\12\270|\30I"
  "\366\263p\2\261\15\270|\30)$B\222%\311\77%\262\24\270|\30)C\262\5\211\5\11\205\11\205"
  "\11\311i$\1\263\14\270|\30\212\303B\362\237\7\25\264\16\270|\30\251\303Br\26\35\262\324\0\265"
  "\17\270|\30\212\303B\362)L\224\360(\1\266\17\270|\30\251\303Br\235\24\64$S\2\267\17\270"
  "|\30\212\303B\246\244FF\302\203\12\270\13\270|\30\311\302D\366i\1\271\13\270|\30I\362\377y"
  "P\1\272\16\270|\30I\362O#\42\204\204E\13\273\14\270|\30I\362\237%I!I\274\22\270|"
  "\30I\62\215\210\20\26\25\222\210\14\311\224\0\275\16\270|\30I\62\215\210\20\26\331i\1\276\14\270|"
  "\30\311\302Fu\62\26N\277\13\270|\30\212\224\354\221P\1\300\11\270|\30K\366\247\5\301\14\270|"
  "\30\212\204Fv\42$T\302\20\270|\30,f%!DA##\17\17\13\303\10\270|\30\177hN"
  "\304\14\270|\30KF'&\17\37\16\305\15\270|\30K\205\303\17\313\203E\13\323\13\270|\30i%"
  "!e\17\77\337\14\270|\30K\366D<X\264\0\340\11\270|\30K\366\247\5\341\14\270|\30K\205"
  "\303D\366\264\0\342\16\270|\30\37\210\12CD\2\213\36\26\0\0\0\4\377\377\0";


// ----------------------------------------------------------------------------------------
//            DCS.BIOS stuff here
// ----------------------------------------------------------------------------------------
void onDedLine1Change(char* newValue) {
  line1 = newValue;
}
DcsBios::StringBuffer<29> dedLine1Buffer(0x450a, onDedLine1Change);

void onDedLine2Change(char* newValue) {
  line2 = newValue;
}
DcsBios::StringBuffer<29> dedLine2Buffer(0x4528, onDedLine2Change);

void onDedLine3Change(char* newValue) {
  line3 = newValue;
}
DcsBios::StringBuffer<29> dedLine3Buffer(0x4546, onDedLine3Change);

void onDedLine4Change(char* newValue) {
  line4 = newValue;
}
DcsBios::StringBuffer<29> dedLine4Buffer(0x4564, onDedLine4Change);

void onDedLine5Change(char* newValue) {
  line5 = newValue;
}
DcsBios::StringBuffer<29> dedLine5Buffer(0x4582, onDedLine5Change);

// ----------------------------------------------------------------------------------------
//            SETUP Section
// ----------------------------------------------------------------------------------------
void setup() {
	DcsBios::setup();
  delay(100); // time to setup the display
  u8g2.begin();
  u8g2.clear();
  u8g2.setFont(u8g2_font_DEDFontNewInv);
}
// ----------------------------------------------------------------------------------------
//            LOOP Section - Try to keep empty !!!
// ----------------------------------------------------------------------------------------
void loop() {
  DcsBios::loop();

// not all lines are refreshed at the same time, so it sometimes results in missing lines while DED manipulation
// therefore, the page buffer method is used to print all lines at once
  u8g2.firstPage();
  do {
    u8g2.setCursor(x, y-1);
    u8g2.print(invertChars(line1));
    u8g2.setCursor(x, (2 * y) -1);
    u8g2.print(invertChars(line2));
    u8g2.setCursor(x, (3 * y) -1);
    u8g2.print(invertChars(line3));
    u8g2.setCursor(x, (4 * y) -1);
    u8g2.print(invertChars(line4));
    u8g2.setCursor(x, (5 * y) -1);
    u8g2.print(invertChars(line5));
  } while (u8g2.nextPage());
  u8g2.updateDisplay();
}

// ----------------------------------------------------------------------------------------
//            Supporting functions
// ----------------------------------------------------------------------------------------

String invertChars(String lineX) {                        // create a function, applied on each DED line and returning the manipulated string
  if (lineX.length() > 25) {                              // look for steering bits only if a line has more than 25 chars
    for (int j = 0; j < 4; j++) {                         // go through each of the 4 bytes
      for (int i = 0; i < 8; i++) {                       // go through each of the 8 bits per byte
        if (bitRead(lineX[25 + j], i) == 1) {             // start at char number 26 [string index is 25 !!!]; if steering bit equals 1 we found a to be inverted char
            int inverted = byte(lineX.charAt(j * 8 + i)); // read the byte value of the char from the string object into a local variable
            lineX.setCharAt(j * 8 + i, inverted + 100);   // replace the char by it's inverted version (byte of the char + 100 in the manipulated font)
        }
      }
    }
    lineX.remove(25, 4);                                  // remove the steering bytes from the string (chars 26 to 29) ...
  } // ... line is cut to 25 chars, so it passes the next loop without further manipulation (see: if lineX.length > 25) 
  return lineX;                                           // function returns the manipulated line
}

 

Regards, Vinc


Edited by Vinc_Vega
  • Like 2
  • Thanks 2

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

  • 2 months later...

Hey guys, I've managed to get the DED going by using a Bluepill STM32 board with a 256x64 SSD1322 display. I am using the following definition.

#ifdef DCSBIOS_FOR_STM32
U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ PA2, /* dc=*/ PA1, /* reset=*/ PA0); // Enable U8G2_16BIT in u8g2.h
#endif
#ifndef DCSBIOS_FOR_STM32
U8G2_SSD1322_NHD_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ PA2, /* dc=*/ PA1, /* reset=*/ PA0); // Enable U8G2_16BIT in u8g2.h
#endif

Everything works fine but the screen refresh rate is somewhat lacking. Can I increase the display refresh rate somehow?

My controls & seat

 

Main controls: , BRD-N v4 Flightstick (Kreml C5 controller), TM Warthog Throttle (Kreml F3 controller), BRD-F2 Restyling Bf-109 Pedals w. damper, TrackIR5, Gametrix KW-908 (integrated into RAV4 seat)

Stick grips:

Thrustmaster Warthog

Thrustmaster Cougar (x2)

Thrustmaster F-16 FLCS

BRD KG13

 

Standby controls:

BRD-M2 Mi-8 Pedals (Ruddermaster controller)

BRD-N v3 Flightstick w. exch. grip upgrade (Kreml C5 controller)

Thrustmaster Cougar Throttle

Pilot seat

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...