Jump to content

Recommended Posts

Posted (edited)

Hallo,

ich habe vor das DED der Viper auf einem OLED 2.42 Zoll Display auszugeben. Ich nutze die U8G2 lib.
Die Test Sketche laufen alle mittlerweile problemlos. Wenn ich aus dem DED nur eine Line anzeigen lasse, funktioniert das auch sehr gut und schnell.
Sobald ich alle Lines ausgeben möchte, gibt das Display nur noch Teile aus. Es sieht so aus als wollte er in die bereits geschriebene Zeile den Text neu hinzufügen und dann kommt Quatsch heraus. Vielleicht kann mir jemand einen Rat geben. Ich danke schonmal in voraus.
 

#define DCSBIOS_DEFAULT_SERIAL


#include "DcsBios.h"
#include <Arduino.h>
#include <Wire.h>
#include <U8g2lib.h>
#include <U8x8lib.h>

U8G2_SSD1309_128X64_NONAME0_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ 13);

void onDedLine1Change(char* newValue) {
    /* your code here */
    u8g2.setFont(u8g2_font_5x7_tf);
    u8g2.drawStr(0,10,newValue);
    u8g2.sendBuffer();
        
}
DcsBios::StringBuffer<25> dedLine1Buffer(0x44fc, onDedLine1Change);

void onDedLine2Change(char* newValue) {
    /* your code here */
    u8g2.setFont(u8g2_font_5x7_tf);
    u8g2.drawStr(0,20,newValue);
    u8g2.sendBuffer();
}
DcsBios::StringBuffer<25> dedLine2Buffer(0x4516, onDedLine2Change);

void onDedLine3Change(char* newValue) {
    /* your code here */
    u8g2.setFont(u8g2_font_5x7_tf);
    u8g2.drawStr(0,30,newValue);
    u8g2.sendBuffer();
}
DcsBios::StringBuffer<25> dedLine3Buffer(0x4530, onDedLine3Change);

void onDedLine4Change(char* newValue) {
    /* your code here */
    u8g2.setFont(u8g2_font_5x7_tf);
    u8g2.drawStr(0,40,newValue);
    u8g2.sendBuffer();
}
DcsBios::StringBuffer<25> dedLine4Buffer(0x454a, onDedLine4Change);

void onDedLine5Change(char* newValue) {
    /* your code here */
    u8g2.setFont(u8g2_font_5x7_tf);
    u8g2.drawStr(0,50,newValue);
    u8g2.sendBuffer();
}
DcsBios::StringBuffer<25> dedLine5Buffer(0x4564, onDedLine5Change);

void setup(void) {
    u8g2.begin();   // Start OLED
    DcsBios::setup();
}

void loop(void) {
 
  DcsBios::loop();
  
}

 

IMG_20210822_170248250.jpg

Edited by DonaldStrehl
  • Recently Browsing   0 members

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