Arjan Posted September 26, 2019 Posted September 26, 2019 Hi Guys! I am trying to connect a 3.5" TFT / AT MEGA 2560 to DCS-BIOS. It's a cheap TFT with an ILI9486 driver. When I connect it with an example sketch and the UTFT Lib it works, using the following init: UTFT myGLCD(ILI9486,38,39,40,41); However when I try the code from robinmli (https://github.com/RobinMLi/DCS-CDU-Display), it won't work. The line: UTFTGLUE myGLCD(0x9488,A2,A1,A3,A4,A0); Is the problem, myGLCD(ILI9486, 38, 39, 40, 41); doesn't work and the screen turns white. Also 0 instead of "ILI9486" is not working. Anybody any ideas?
Arjan Posted September 27, 2019 Author Posted September 27, 2019 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
Arjan Posted September 27, 2019 Author Posted September 27, 2019 (edited) Updated version of DefaultFonts.txt, now including right and left arrowDefaultFonts.txt Edited September 27, 2019 by Arjan
lesthegrngo Posted September 30, 2019 Posted September 30, 2019 Updated version of DefaultFonts.txt, now including right and left arrow Many thanks for this! Cheers Les
BlackLibrary Posted October 5, 2019 Posted October 5, 2019 can i integrad it into our DCS BIOS andurino.zip (link in sig) so that everybody has a benefit from it? aka WarLord DCSFlightpanels DCS-BIOS Fork DCSFlightpanels arduino-library DCSFlightpanels DCSFlightpanels-Profiles DCS FP / BIOS Discord Server
lesthegrngo Posted January 5, 2020 Posted January 5, 2020 (edited) Guys, the sketch above works perfectly on the 3 1/5 inch TFT screen I have, but I would like to get it working with a 5 inch TFT screen that I have that uses a RA8875 Arduino Uno shield. This is what I have https://www.buydisplay.com/arduino-5-inch-tft-lcd-touch-screen-shield-ra8875-library-for-mega-due-uno I have had a go at splicing in the code from the CDU sketch, but with a complete lack of success. Has anyone else tried this, or is there anyone who can help? This is what I have tried, which gives an error compiling /* 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. */ #define DCSBIOS_IRQ_SERIAL #include <SPI.h> #include <RA8875.h> #include "DcsBios.h" //Arduino DUE,Arduino mega2560,Arduino UNO #define RA8875_INT 4 #define RA8875_CS 10 #define RA8875_RST 9 RA8875 tft = RA8875(RA8875_CS,RA8875_RST); void printChar(int row, int col, unsigned char c) { int16_t x = 13 + col * 19; int16_t y = row * 32 + 6; } /* paste code snippets from the reference documentation here */ void onCduLine0Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(0, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine0Buffer(0x11c0, onCduLine0Change); void onCduLine1Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(1, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine1Buffer(0x11d8, onCduLine1Change); void onCduLine2Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(2, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine2Buffer(0x11f0, onCduLine2Change); void onCduLine3Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(3, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine3Buffer(0x1208, onCduLine3Change); void onCduLine4Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(4, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine4Buffer(0x1220, onCduLine4Change); void onCduLine5Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(5, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine5Buffer(0x1238, onCduLine5Change); void onCduLine6Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(6, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine6Buffer(0x1250, onCduLine6Change); void onCduLine7Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(7, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine7Buffer(0x1268, onCduLine7Change); void onCduLine8Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(8, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine8Buffer(0x1280, onCduLine8Change); void onCduLine9Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(9, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine9Buffer(0x1298, onCduLine9Change); void setup() { DcsBios::setup(); Serial.begin(9600); //while (!Serial) {;} tft.begin(RA8875_480x272); // Setup the LCD } void loop() { DcsBios::loop(); } Cheers Les Edited January 5, 2020 by lesthegrngo
Vinc_Vega Posted January 7, 2020 Posted January 7, 2020 (edited) Hello Les, you also have to include the GFX library. #include <Adafruit_GFX.h>Than try it after excluding all the "serial" statements within the setup block. Like this: void setup() { DcsBios::setup(); // Setup the LCD // Serial.begin(9600); // while (!Serial); SPI.begin(); tft.begin(); // set landscape mode tft.setRotation(1); ... Edited January 7, 2020 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
lesthegrngo Posted January 7, 2020 Posted January 7, 2020 Thanks Vinc, when I get home tonight will give that a go. If I can get the 5" screen working as well as the 3.5" version, my CDU will look amazing. I used a Leo Bodnar BBI-64 to connect the main buttons and it's so cool to use the CDU to enter all the data and see it being displayed real time Cheers Les
Vinc_Vega Posted January 7, 2020 Posted January 7, 2020 (edited) Sounds great! At the weekend I transformed my script from a 3.5" mcufriend Display to the 4" waveshare SPI display. As processor I use a NANO connectet via USB and not RS485. I wonder if the Duo or Zero would give faster refresh time when flipping the pages of the CDU than the UNO/NANO? For the CDU button matrix I'm still looking for a suitable solution. Edited January 7, 2020 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
lesthegrngo Posted January 7, 2020 Posted January 7, 2020 I can't recommend the Bodnar boards enough, they are so easy to use, and easily configurable for rotary encoders. One board does 64 inputs, so virtually all the CDU inputs are catered for on one board. I have three of them, one dedicated to the CDU, another that connect the remaining 8 CDU inputs plus the two MFCD's, and the remaining one is assigned to all the various switches and encoders on the right console. I also have a couple of the Bu036x joystick boards, and they are doing duty for the armament panel, landing gear panel switches plus the potentiometers on the CMSC and MFCD's I have to get two more BBI-64's to cater for the left console inputs, but that can wait until I've made that. They are totally lag free, and even though they are USB don't confilct with each other Cheers Les
Matchstick Posted January 7, 2020 Posted January 7, 2020 Sounds great! At the weekend I transformed my script from a 3.5" mcufriend Display to the 4" waveshare SPI display. As processor I use a NANO connectet via USB and not RS485. I wonder if the Duo or Zero would give faster refresh time when flipping the pages of the CDU than the UNO/NANO? For the CDU button matrix I'm still looking for a suitable solution. Are the Due/Zero compatible with the current version of DCS-BIOS ? It's on my list of projects to grab one for testing but there's quite a few things ahead of it :)
lesthegrngo Posted January 8, 2020 Posted January 8, 2020 Vinc, I included the library quoted and also made the adjustments suggested Here's what I have now, which at least powers up the TFT! /* 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. */ #define DCSBIOS_IRQ_SERIAL #include <SPI.h> #include <RA8875.h> #include "DcsBios.h" #include <Adafruit_GFX.h> //Arduino DUE,Arduino mega2560,Arduino UNO #define RA8875_INT 4 #define RA8875_CS 10 #define RA8875_RST 9 RA8875 tft = RA8875(RA8875_CS,RA8875_RST); void printChar(int row, int col, unsigned char c) { int16_t x = 13 + col * 19; int16_t y = row * 32 + 6; } /* paste code snippets from the reference documentation here */ void onCduLine0Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(0, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine0Buffer(0x11c0, onCduLine0Change); void onCduLine1Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(1, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine1Buffer(0x11d8, onCduLine1Change); void onCduLine2Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(2, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine2Buffer(0x11f0, onCduLine2Change); void onCduLine3Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(3, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine3Buffer(0x1208, onCduLine3Change); void onCduLine4Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(4, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine4Buffer(0x1220, onCduLine4Change); void onCduLine5Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(5, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine5Buffer(0x1238, onCduLine5Change); void onCduLine6Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(6, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine6Buffer(0x1250, onCduLine6Change); void onCduLine7Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(7, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine7Buffer(0x1268, onCduLine7Change); void onCduLine8Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(8, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine8Buffer(0x1280, onCduLine8Change); void onCduLine9Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(9, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine9Buffer(0x1298, onCduLine9Change); void setup() { DcsBios::setup(); //Serial.begin(9600); //while (!Serial) {;} SPI.begin(); tft.begin(RA8875_480x272); // set landscape mode tft.setRotation(1); } void loop() { DcsBios::loop(); } I had to keep the following statement as is tft.begin(RA8875_480x272); if I used your suggestion of tft.begin(); it would give a compiling error However it still isn't working, DCS BIOS no data shows on the screen, although worryingly some random coloured lines do the moment it's powered up, making me wonder if it's a duff screen. In order to check the screen I loaded one of the example sketches form the sellers site, and got the TFT working displaying text but the lines are still present so I am in contact with the seller to get a replacement. However the fact that the screen showed information using the second sketch shows that there is still something we need to run to ground on the CDU sketch. Again, many thanks for your help on this, certainly getting closer! Cheers Les
Vinc_Vega Posted January 8, 2020 Posted January 8, 2020 ... In order to check the screen I loaded one of the example sketches form the sellers site, and got the TFT working displaying text but the lines are still present so I am in contact with the seller to get a replacement. ... Hi Les, would you please give a link to the sketch you have uploaded sucessfully or better post the working sketch here? What driver library do you have installed (Adafruit_RA8875 or plain RA8875)? Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
lesthegrngo Posted January 8, 2020 Posted January 8, 2020 Plain RA8875, and the examples I used are the ones at the bottom of this page https://www.buydisplay.com/serial-spi-arduino-5-inch-tft-lcd-touch-shield-ra8875-for-mega-due-uno I can send you what I got working when I get home Cheers Les
Vinc_Vega Posted January 8, 2020 Posted January 8, 2020 (edited) Hi Les, Within the declaration of you printChar() object an essential token is missing. Put the red line in your code and it should work. To simplify things, before that a text color should be defined (else use hex 0x07E0). [b][color=SeaGreen]#define GREEN 0x07E0[/color][/b] void printChar(int row, int col, unsigned char c) { int16_t x = 13 + col * 19; int16_t y = row * 32 + 6; [color=Red][b]tft.drawChar(x, y, c, GREEN, 0x0, 3);[/b][/color] } Here is how the object constructor works for your information: drawChar(x position, y position, character to print, text color, bg color, text size); Edit: If your display really use a resolution of 480 x 272, text size and / or space between the lines (rows) should be reduced. . Edited January 8, 2020 by Vinc_Vega additional information Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
lesthegrngo Posted January 9, 2020 Posted January 9, 2020 Hi Vinc, here is the actual sketch I was testing with which shows scrolling text /*************************************************** //Web: http://www.buydisplay.com EastRising Technology Co.,LTD Examples for ER-TFTM050-2 Hardware SPI,4-Wire SPI Interface,5V Power Supply Basic Scroll example Tested and worked with: Teensy3,Teensy3.1,Arduino UNO,Arduino YUN,Arduino Leonardo,Stellaris Works with Arduino 1.6.0 IDE ****************************************************/ #include <SPI.h> #include <RA8875.h> //Arduino DUE,Arduino mega2560,Arduino UNO #define RA8875_INT 4 #define RA8875_CS 10 #define RA8875_RESET 9 RA8875 tft = RA8875(RA8875_CS,RA8875_RESET);//Teensy3/arduino's //#endif void setup() { Serial.begin(9600); //while (!Serial) {;} Serial.println("RA8875 start"); //initialization routine tft.begin(RA8875_800x480); //following it's already by begin function but //if you like another background color.... //RA8875 it's capable to draw graphic but also Text //here we switch to TEXT mode //now set a text color, background transparent tft.setTextColor(RA8875_BLUE); //use the classic print an println command tft.print("www.buydisplay.com"); //by default the text location is set to 0,0 //now set it at 50,20 pixels and different color tft.setCursor(50,20);//set cursor work in pixel!!! //this time we not using transparent background tft.setTextColor(RA8875_RED,RA8875_RED); tft.print("www.buydisplay.com"); //by default we using the internal font //so some manipulation it's possible tft.setFontScale(1);//font x2 tft.setTextColor(RA8875_WHITE); tft.print("Hello World"); //You notice that font location has been //automatically increased by chip, unfortunatly not //tracked by library but we can use a command for that... uint16_t currentX,currentY; //now we have the location, lets draw a white pixel tft.drawPixel(currentX,currentY,RA8875_WHITE); //did you see the white dot? tft.setFontScale(0);//font x1 tft.setCursor(0,50); tft.setTextColor(RA8875_YELLOW); tft.println("ABCDEF 1 2 3 4");//this time println! tft.setFontSpacing(5);//now give 5 pix spacing tft.println("ABCDEF 1 2 3 4"); tft.setFontSpacing(0);//reset tft.println("www.buydisplay.com"); tft.setFontScale(2);//font x1 tft.setTextColor(RA8875_BLUE,RA8875_BLACK); } uint16_t i = 0; void loop() { tft.setScrollWindow(0,320,0,60); //Specifies scrolling activity area i=0; while(i++<60){ delay(10); tft.scroll(i,i); } //Note: scroll offset value must be less than scroll setting range while(i-->0){ delay(10); tft.scroll(i,i); } while(i++<60){ delay(10); tft.scroll(i,i); } while(i-->0){ delay(10); tft.scroll(i,i); } } Note that I incorrectly set the resolution before, it should have been 800 x 480, which was why I was getting the lines down the side of the screen, so thankfully not a duff screen I tried splicing in that bit of code, as below but get the error that drawChar is not a member, I tried changing to printChar with the same result Here's the sketch that gives the compiling error /* 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. */ #define DCSBIOS_IRQ_SERIAL #include <SPI.h> #include <RA8875.h> #include "DcsBios.h" #include <Adafruit_GFX.h> //Arduino DUE,Arduino mega2560,Arduino UNO #define RA8875_INT 4 #define RA8875_CS 10 #define RA8875_RST 9 #define GREEN 0x07E0 RA8875 tft = RA8875(RA8875_CS,RA8875_RST); void printChar(int row, int col, unsigned char c) { int16_t x = 13 + col * 19; int16_t y = row * 32 + 6; tft.drawChar(x, y, c, GREEN, 0x0, 3); } void printChar(int row, int col, unsigned char c) { int16_t x = 13 + col * 19; int16_t y = row * 32 + 6; } /* paste code snippets from the reference documentation here */ void onCduLine0Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(0, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine0Buffer(0x11c0, onCduLine0Change); void onCduLine1Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(1, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine1Buffer(0x11d8, onCduLine1Change); void onCduLine2Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(2, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine2Buffer(0x11f0, onCduLine2Change); void onCduLine3Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(3, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine3Buffer(0x1208, onCduLine3Change); void onCduLine4Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(4, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine4Buffer(0x1220, onCduLine4Change); void onCduLine5Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(5, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine5Buffer(0x1238, onCduLine5Change); void onCduLine6Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(6, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine6Buffer(0x1250, onCduLine6Change); void onCduLine7Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(7, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine7Buffer(0x1268, onCduLine7Change); void onCduLine8Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(8, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine8Buffer(0x1280, onCduLine8Change); void onCduLine9Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(9, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine9Buffer(0x1298, onCduLine9Change); void setup() { DcsBios::setup(); //Serial.begin(9600); //while (!Serial) {;} SPI.begin(); tft.begin(RA8875_800x480); // set landscape mode tft.setRotation(1); } void loop() { DcsBios::loop(); } Cheers! Les
Vinc_Vega Posted January 9, 2020 Posted January 9, 2020 Hi Les, the printChar() object has been declarated twice within your code, but this relates not the compiling error. It's the missing drawChar decleration within the used RA8875 driver. By changing to the Adafruit_RA8875 driver the drawChar function seems to work. It is essential to the code because only this statement prints the characters on display. I used the driver from your download link and it compiles well, but without the related hardware I can't proof it. I put the Adafruit driver into your code and did a little welcome screen to the setup function (that can be deleted if the code works). Furthermore I changed the colors back to the color definitions from the RA8875 example. I'm not shure if "setRotation" is declared within the driver, but this can be adjusted later, same for the text size and line distances. I hope that the code now works for you. /* 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. */ #define DCSBIOS_IRQ_SERIAL #include <SPI.h> [color=gray]//#include <RA8875.h>[/color] [color=Red]#include "Adafruit_RA8875.h"[/color] #include "DcsBios.h" #include <Adafruit_GFX.h> //Arduino DUE,Arduino mega2560,Arduino UNO #define RA8875_INT 4 #define RA8875_CS 10 #define RA8875_RST 9 [color=Gray]// RA8875 tft = RA8875(RA8875_CS,RA8875_RST);[/color] [color=Red]Adafruit_RA8875 tft = Adafruit_RA8875(RA8875_CS, RA8875_RST);[/color] void printChar(int row, int col, unsigned char c) { int16_t x = 13 + col * 19; int16_t y = row * 32 + 6; tft.drawChar(x, y, c, RA8875_GREEN, RA8875_BLACK, 3); } /* paste code snippets from the reference documentation here */ void onCduLine0Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(0, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine0Buffer(0x11c0, onCduLine0Change); void onCduLine1Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(1, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine1Buffer(0x11d8, onCduLine1Change); void onCduLine2Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(2, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine2Buffer(0x11f0, onCduLine2Change); void onCduLine3Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(3, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine3Buffer(0x1208, onCduLine3Change); void onCduLine4Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(4, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine4Buffer(0x1220, onCduLine4Change); void onCduLine5Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(5, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine5Buffer(0x1238, onCduLine5Change); void onCduLine6Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(6, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine6Buffer(0x1250, onCduLine6Change); void onCduLine7Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(7, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine7Buffer(0x1268, onCduLine7Change); void onCduLine8Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(8, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine8Buffer(0x1280, onCduLine8Change); void onCduLine9Change(char* newValue) { for(int i = 0; i < 24; i++){ printChar(9, i, newValue[i]); } } DcsBios::StringBuffer<24> cduLine9Buffer(0x1298, onCduLine9Change); void setup() { DcsBios::setup(); //Serial.begin(9600); //while (!Serial) {;} SPI.begin(); tft.begin(RA8875_800x480); // set landscape mode tft.setRotation(1); [color=gray]// --------------- section can be deletet if it works // print welcome screen tft.fillScreen(RA8875_BLACK); // fast "clear screen" tft.drawRoundRect(0, 0, 799, 479, 10, RA8875_GREEN); delay(300); tft.setTextColor(RA8875_GREEN); tft.setTextSize(3); tft.setCursor(100, 260); tft.print("DCS World: A-10C"); tft.setCursor(100, 285); tft.print("CDU Display Test"); delay(1500); tft.fillScreen(RA8875_BLACK); // ---------------------------------------------------[/color] } void loop() { DcsBios::loop(); } Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
lesthegrngo Posted January 9, 2020 Posted January 9, 2020 Thank Vinc, just tried compiling it and get errors this is the error file Arduino: 1.8.9 (Windows 10), Board: "Arduino/Genuino Uno" C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Thomas\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10809 -build-path C:\Users\Thomas\AppData\Local\Temp\arduino_build_239535 -warnings=none -build-cache C:\Users\Thomas\AppData\Local\Temp\arduino_cache_222093 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Thomas\Documents\Arduino\CDU_USB_sketch_5_inch\CDU_USB_sketch_5_inch.ino C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Thomas\Documents\Arduino\libraries -fqbn=arduino:avr:uno -vid-pid=0X2341_0X0043 -ide-version=10809 -build-path C:\Users\Thomas\AppData\Local\Temp\arduino_build_239535 -warnings=none -build-cache C:\Users\Thomas\AppData\Local\Temp\arduino_cache_222093 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.2.1.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino14.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-5.4.0-atmel3.6.1-arduino2.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\Thomas\Documents\Arduino\CDU_USB_sketch_5_inch\CDU_USB_sketch_5_inch.ino Using board 'uno' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr Detecting libraries used... "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\sketch\\CDU_USB_sketch_5_inch.ino.cpp" -o nul "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\sketch\\CDU_USB_sketch_5_inch.ino.cpp" -o nul "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\Thomas\\Documents\\Arduino\\libraries\\Adafruit_RA8875" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\sketch\\CDU_USB_sketch_5_inch.ino.cpp" -o nul "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\Thomas\\Documents\\Arduino\\libraries\\Adafruit_RA8875" "-IC:\\Users\\Thomas\\Documents\\Arduino\\libraries\\Adafruit_GFX_Library" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\sketch\\CDU_USB_sketch_5_inch.ino.cpp" -o nul "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\Thomas\\Documents\\Arduino\\libraries\\Adafruit_RA8875" "-IC:\\Users\\Thomas\\Documents\\Arduino\\libraries\\Adafruit_GFX_Library" "-IC:\\Users\\Thomas\\Documents\\Arduino\\libraries\\dcs-bios-arduino-library-master\\src" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\sketch\\CDU_USB_sketch_5_inch.ino.cpp" -o nul Using cached library dependencies for file: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI\src\SPI.cpp Using cached library dependencies for file: C:\Users\Thomas\Documents\Arduino\libraries\Adafruit_RA8875\Adafruit_RA8875.cpp Using cached library dependencies for file: C:\Users\Thomas\Documents\Arduino\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp Using cached library dependencies for file: C:\Users\Thomas\Documents\Arduino\libraries\Adafruit_GFX_Library\Adafruit_SPITFT.cpp Using cached library dependencies for file: C:\Users\Thomas\Documents\Arduino\libraries\Adafruit_GFX_Library\glcdfont.c Using cached library dependencies for file: C:\Users\Thomas\Documents\Arduino\libraries\dcs-bios-arduino-library-master\src\internal\Protocol.cpp Generating function prototypes... "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\Thomas\\Documents\\Arduino\\libraries\\Adafruit_RA8875" "-IC:\\Users\\Thomas\\Documents\\Arduino\\libraries\\Adafruit_GFX_Library" "-IC:\\Users\\Thomas\\Documents\\Arduino\\libraries\\dcs-bios-arduino-library-master\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\EEPROM\\src" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\sketch\\CDU_USB_sketch_5_inch.ino.cpp" -o "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\preproc\\ctags_target_for_gcc_minus_e.cpp" "C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\preproc\\ctags_target_for_gcc_minus_e.cpp" Compiling sketch... "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10809 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\SPI\\src" "-IC:\\Users\\Thomas\\Documents\\Arduino\\libraries\\Adafruit_RA8875" "-IC:\\Users\\Thomas\\Documents\\Arduino\\libraries\\Adafruit_GFX_Library" "-IC:\\Users\\Thomas\\Documents\\Arduino\\libraries\\dcs-bios-arduino-library-master\\src" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\libraries\\EEPROM\\src" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\sketch\\CDU_USB_sketch_5_inch.ino.cpp" -o "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\sketch\\CDU_USB_sketch_5_inch.ino.cpp.o" Compiling libraries... Compiling library "SPI" Using previously compiled file: C:\Users\Thomas\AppData\Local\Temp\arduino_build_239535\libraries\SPI\SPI.cpp.o Compiling library "Adafruit_RA8875" Using previously compiled file: C:\Users\Thomas\AppData\Local\Temp\arduino_build_239535\libraries\Adafruit_RA8875\Adafruit_RA8875.cpp.o Compiling library "Adafruit_GFX_Library" Using previously compiled file: C:\Users\Thomas\AppData\Local\Temp\arduino_build_239535\libraries\Adafruit_GFX_Library\glcdfont.c.o Using previously compiled file: C:\Users\Thomas\AppData\Local\Temp\arduino_build_239535\libraries\Adafruit_GFX_Library\Adafruit_GFX.cpp.o Using previously compiled file: C:\Users\Thomas\AppData\Local\Temp\arduino_build_239535\libraries\Adafruit_GFX_Library\Adafruit_SPITFT.cpp.o Compiling library "dcs-bios-arduino-library-master" Using previously compiled file: C:\Users\Thomas\AppData\Local\Temp\arduino_build_239535\libraries\dcs-bios-arduino-library-master\internal\Protocol.cpp.o Compiling library "EEPROM" Compiling core... Using precompiled core: C:\Users\Thomas\AppData\Local\Temp\arduino_cache_222093\core\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a Linking everything together... "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535/CDU_USB_sketch_5_inch.ino.elf" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\sketch\\CDU_USB_sketch_5_inch.ino.cpp.o" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\libraries\\SPI\\SPI.cpp.o" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\libraries\\Adafruit_RA8875\\Adafruit_RA8875.cpp.o" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\libraries\\Adafruit_GFX_Library\\Adafruit_GFX.cpp.o" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\libraries\\Adafruit_GFX_Library\\Adafruit_SPITFT.cpp.o" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\libraries\\Adafruit_GFX_Library\\glcdfont.c.o" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535\\libraries\\dcs-bios-arduino-library-master\\internal\\Protocol.cpp.o" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535/..\\arduino_cache_222093\\core\\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a" "-LC:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_239535" -lm HardwareSerial0.cpp.o (symbol from plugin): In function `Serial': (.text+0x0): multiple definition of `__vector_18' C:\Users\Thomas\AppData\Local\Temp\arduino_build_239535\sketch\CDU_USB_sketch_5_inch.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here collect2.exe: error: ld returned 1 exit status Multiple libraries were found for "Adafruit_RA8875.h" Used: C:\Users\Thomas\Documents\Arduino\libraries\Adafruit_RA8875 Not used: C:\Users\Thomas\Documents\Arduino\libraries\Adafruit_RA8875-master Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI Using library Adafruit_RA8875 at version 1.3.4 in folder: C:\Users\Thomas\Documents\Arduino\libraries\Adafruit_RA8875 Using library Adafruit_GFX_Library at version 1.5.6 in folder: C:\Users\Thomas\Documents\Arduino\libraries\Adafruit_GFX_Library Using library dcs-bios-arduino-library-master at version 0.2.10 in folder: C:\Users\Thomas\Documents\Arduino\libraries\dcs-bios-arduino-library-master Using library EEPROM at version 2.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM exit status 1 Error compiling for board Arduino/Genuino Uno. something on my PC? Cheers Les
Vinc_Vega Posted January 9, 2020 Posted January 9, 2020 Sorry Les, but there is no hint in the error file that helps. Maybe the problem is, that you have two different Adafruit_RA8875 libraries installed? If I get those "Error compiling for Board Arduino/something" messages I usually replug the board and/or restart the GUI. Mostly that helps. I just copied the code from the post above again, put it into the arduino GUI and compiled/uploaded it without any errors. The "ino" file is zipped and attached hereunder for info. My System is Windows 7 64bit and I use Arduino GUI 1.8.10 with latest board definitions. .CDU_DISPLAY_LES_Test02a.rar Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
lesthegrngo Posted January 9, 2020 Posted January 9, 2020 ok, Vinc, will try it - Like I said, maybe my PC? Fingers crossed, will delete the spare library as suggested Cheers! Les
lesthegrngo Posted January 9, 2020 Posted January 9, 2020 (edited) Gave it a go, but something is still preventing the compiling. Strange, it doesn't indicate missing libraries or anything The etror changed after deleting the extra library reference to the following Archiving built core (caching) in: C:\Users\Thomas\AppData\Local\Temp\arduino_cache_82859\core\core_arduino_avr_uno_0c812875ac70eb4a9b385d8fb077f54c.a Linking everything together... "C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_616991/CDU_USB_sketch_5_inch.ino.elf" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_616991\\sketch\\CDU_USB_sketch_5_inch.ino.cpp.o" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_616991\\libraries\\SPI\\SPI.cpp.o" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_616991\\libraries\\Adafruit_RA8875\\Adafruit_RA8875.cpp.o" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_616991\\libraries\\Adafruit_GFX_Library\\Adafruit_GFX.cpp.o" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_616991\\libraries\\Adafruit_GFX_Library\\Adafruit_SPITFT.cpp.o" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_616991\\libraries\\Adafruit_GFX_Library\\glcdfont.c.o" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_616991\\libraries\\dcs-bios-arduino-library-master\\internal\\Protocol.cpp.o" "C:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_616991/core\\core.a" "-LC:\\Users\\Thomas\\AppData\\Local\\Temp\\arduino_build_616991" -lm HardwareSerial0.cpp.o (symbol from plugin): In function `Serial': (.text+0x0): multiple definition of `__vector_18' C:\Users\Thomas\AppData\Local\Temp\arduino_build_616991\sketch\CDU_USB_sketch_5_inch.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here collect2.exe: error: ld returned 1 exit status Using library SPI at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI Using library Adafruit_RA8875 at version 1.3.4 in folder: C:\Users\Thomas\Documents\Arduino\libraries\Adafruit_RA8875 Using library Adafruit_GFX_Library at version 1.5.6 in folder: C:\Users\Thomas\Documents\Arduino\libraries\Adafruit_GFX_Library Using library dcs-bios-arduino-library-master at version 0.2.10 in folder: C:\Users\Thomas\Documents\Arduino\libraries\dcs-bios-arduino-library-master Using library EEPROM at version 2.0 in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM exit status 1 Error compiling for board Arduino/Genuino Uno. I'm not sure what the multiple references does, I wonder whether I have conflicting libraries in my PC? ***EDIT*** Can you do the sketch without the DCS BIOS references to see if the error is in the DCS part? Les Edited January 9, 2020 by lesthegrngo
Vinc_Vega Posted January 9, 2020 Posted January 9, 2020 (edited) This is how it should look like without the DCS BIOS stuff. A welcome screen going into black after 1 1/2 seconds. #include <SPI.h> //#include <RA8875.h> #include "Adafruit_RA8875.h" #include <Adafruit_GFX.h> //Arduino DUE,Arduino mega2560,Arduino UNO #define RA8875_INT 4 #define RA8875_CS 10 #define RA8875_RST 9 // RA8875 tft = RA8875(RA8875_CS,RA8875_RST); Adafruit_RA8875 tft = Adafruit_RA8875(RA8875_CS, RA8875_RST); void setup() { SPI.begin(); tft.begin(RA8875_800x480); // set landscape mode tft.setRotation(1); // --------------- section can be deletet if it works // print welcome screen tft.fillScreen(RA8875_BLACK); // fast "clear screen" tft.drawRoundRect(0, 0, 799, 479, 10, RA8875_GREEN); delay(300); tft.setTextColor(RA8875_GREEN); tft.setTextSize(3); tft.setCursor(100, 260); tft.print("DCS World: A-10C"); tft.setCursor(100, 285); tft.print("CDU Display Test"); delay(1500); tft.fillScreen(RA8875_BLACK); // --------------------------------------------------- } void loop() { } EDIT: You can also try to replace all your RA8875_RST statements with RA8875_RESET Edited January 9, 2020 by Vinc_Vega Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
lesthegrngo Posted January 9, 2020 Posted January 9, 2020 Right, without the DCS BIOS stuff it compiled fine, but did not show anything on the TFT, so whatever is doing the error is in the DCS Bios part. But I wonder whether the hardware I have is a bit selective about the RA8875 library it uses, which is a part that you would not find easy to overcome without having the hardware Cheers as ever for all your help Les
Vinc_Vega Posted January 9, 2020 Posted January 9, 2020 Yeah that's right. Sorry, but I'm not a programmer and without hardware it makes less sense to me. You first should use one of the text examples coming with the library to write some own text on your screen. I recommend to use the Adafruit library, as it is working togheter with their GFX library. If you understand the syntax, your code can be expanded to show some text from DCS (a line from the CDU or CMSP). Maybe you can find the issue and can use the above CDU code snippets again. . Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
lesthegrngo Posted January 9, 2020 Posted January 9, 2020 I have nothing to lose by trying! Obviously I appreciate any input you can give, but you've narrowed it down so let me play with it and see if I can get it doing something - once it does, we can see it on here and maybe solve it. From my point of view, I know that I need help with these sort of things, so if I can help solve this and help others in the process it's a win / win situation Let's see how I get on Thanks Les
Recommended Posts