FIXED!
Did not find the issue with the UTFTGLUE lib. The whole solution with MCUFriend and the Adafruit-GFX lib is also quite complicated.
I prefer to just use the standard UTFT lib. The problem (documented on lots of threads here) is the font (Bigfont) has 95 characters, that's not enough for DCS-BIOS, it needs 255 characters.
For that reason I modified the Bigfont font of the UTFT lib, to hold 255 cars, and added the missing characters like up-down arrow, bullseye, degree symbol etc...
For this to work you have to download the attached DefaultFonts.txt file, rename it to DefaultFonts.c. Then rename the DefaultsFonts.c file in your UTFT library to DefaultFonts.bak and place the new file in the same subdir.
Code:
/*
Tell DCS-BIOS to use a serial connection and use the default Arduino Serial
library. This will work on the vast majority of Arduino-compatible boards,
but you can get corrupted data if you have too many or too slow outputs
(e.g. when you have multiple character displays), because the receive
buffer can fill up if the sketch spends too much time updating them.
If you can, use the IRQ Serial connection instead.
File modified by Arjan Grootenboer
*/
#include <UTFT.h>
// Declare which fonts we will be using
extern uint8_t SmallFont[];
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
extern uint8_t A10CFont[];
#define DCSBIOS_IRQ_SERIAL
#include "DcsBios.h"
UTFT myGLCD(ILI9486,38,39,40,41);
void printChar(int row, int col, char* newValue) {
int16_t x = 13 + col * 19;
int16_t y = row * 32 + 6;
myGLCD.print( newValue, CENTER, y );
}
/* paste code snippets from the reference documentation here */
void onCduLine0Change(char* newValue) {
printChar(0, 0, newValue);
}
DcsBios::StringBuffer<24> cduLine0Buffer(0x11c0, onCduLine0Change);
void onCduLine1Change(char* newValue) {
printChar(1, 0, newValue);
}
DcsBios::StringBuffer<24> cduLine1Buffer(0x11d8, onCduLine1Change);
void onCduLine2Change(char* newValue) {
printChar(2, 0, newValue);
}
DcsBios::StringBuffer<24> cduLine2Buffer(0x11f0, onCduLine2Change);
void onCduLine3Change(char* newValue) {
printChar(3, 0, newValue);
}
DcsBios::StringBuffer<24> cduLine3Buffer(0x1208, onCduLine3Change);
void onCduLine4Change(char* newValue) {
printChar( 4,0, newValue);
}
DcsBios::StringBuffer<24> cduLine4Buffer(0x1220, onCduLine4Change);
void onCduLine5Change(char* newValue) {
printChar(5,0, newValue);
}
DcsBios::StringBuffer<24> cduLine5Buffer(0x1238, onCduLine5Change);
void onCduLine6Change(char* newValue) {
printChar( 6, 0, newValue);
}
DcsBios::StringBuffer<24> cduLine6Buffer(0x1250, onCduLine6Change);
void onCduLine7Change(char* newValue) {
printChar(7, 0, newValue);
}
DcsBios::StringBuffer<24> cduLine7Buffer(0x1268, onCduLine7Change);
void onCduLine8Change(char* newValue) {
printChar( 8,0, newValue);
}
DcsBios::StringBuffer<24> cduLine8Buffer(0x1280, onCduLine8Change);
void onCduLine9Change(char* newValue) {
printChar( 9, 0, newValue);
}
DcsBios::StringBuffer<24> cduLine9Buffer(0x1298, onCduLine9Change);
void setup() {
DcsBios::setup();
myGLCD.InitLCD();
myGLCD.clrScr();
myGLCD.setColor(199,234,70);
myGLCD.setFont(BigFont);
}
void loop() {
DcsBios::loop();
} DefaultFonts.txt