Hello, and thanks for helping me. This is my first post after browsing the threads for some time, but I may still commit some faus pax. So please forgive me.
I'm using an Arduino Mega 2560 R3 and a ILI9225 TFT display. They work fine with both the Arduino TFT and the TFT_22_ILI9225.h libraries (see bottom for links). However, when I install and include any of the Adafruit_GFX libraries I get the following error message. I think this line is the key to the problem, but I included it all just in case. Mind you, I'm not sure how to even read the message.
note: previous declaration as 'typedef struct GFXfont GFXfont'
If I need to go with different libraries that's fine. The keys I'm looking for are being able to rotate the screen to landscape, and have about 3 different sized thick bold fonts (about 20, 50 and 80 pixels tall).
If you know of a non-GFX font I can use that would be great. I just have no idea how to build one or install it into an Arduino sketch.
Any ideas are MORE than welcome!
Arduino: 1.8.5 (Windows 10), TD: 1.45, Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
In file included from C:\Users\chris\Documents\Arduino\libraries\TFT_22_ILI9225-1.4.0\src/TFT_22_ILI9225.h:25:0,
from C:\Users\chris\Google Drive\Arduino\Screen_Tester_2\Screen_Tester_2.ino:7:
C:\Users\chris\Documents\Arduino\libraries\TFT_22_ILI9225-1.4.0\src/gfxfont.h:14:3: error: conflicting declaration 'typedef struct GFXglyph GFXglyph'
} GFXglyph;
^
In file included from C:\Program Files (x86)\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:10:0,
from C:\Users\chris\Google Drive\Arduino\Screen_Tester_2\Screen_Tester_2.ino:2:
C:\Program Files (x86)\Arduino\libraries\Adafruit_GFX_Library/gfxfont.h:18:3: note: previous declaration as 'typedef struct GFXglyph GFXglyph'
} GFXglyph;
^
In file included from C:\Users\chris\Documents\Arduino\libraries\TFT_22_ILI9225-1.4.0\src/TFT_22_ILI9225.h:25:0,
from C:\Users\chris\Google Drive\Arduino\Screen_Tester_2\Screen_Tester_2.ino:7:
C:\Users\chris\Documents\Arduino\libraries\TFT_22_ILI9225-1.4.0\src/gfxfont.h:21:3: error: conflicting declaration 'typedef struct GFXfont GFXfont'
} GFXfont;
^
In file included from C:\Program Files (x86)\Arduino\libraries\Adafruit_GFX_Library/Adafruit_GFX.h:10:0,
from C:\Users\chris\Google Drive\Arduino\Screen_Tester_2\Screen_Tester_2.ino:2:
C:\Program Files (x86)\Arduino\libraries\Adafruit_GFX_Library/gfxfont.h:27:3: note: previous declaration as 'typedef struct GFXfont GFXfont'
} GFXfont;
^
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Here is my code. Note: if you comment out the first 4 lines, it works just fine. If any one of them is there, It won't compile. And yes, I've installed all the necessary libraries as far as I can tell.
#include <Adafruit_GFX.h>
#include <Adafruit_SPITFT.h>
#include <Adafruit_SPITFT_Macros.h>
#include <gfxfont.h>
#include <TFT_22_ILI9225.h>
#include <SPI.h>
#define CS A5
#define RS A3
#define RESET A4
#define SDI A2
#define CLK A1
#define LED A0
#define BRIGHTNESS 0
TFT_22_ILI9225 screen = TFT_22_ILI9225(RESET, RS, CS, SDI, CLK, LED);
void setup() {
screen.begin();
screen.setBackgroundColor(COLOR_BLACK);
screen.setOrientation(1);
screen.setColor(255,255,255);
screen.drawText(10, 10, "HI!", COLOR_GREEN);
}
void loop() {
screen.drawText(50, 50, "HI! ", COLOR_RED);
delay(1000);
screen.drawText(50, 50, "BYE!", COLOR_BLUE);
delay(1000);
}
Finally i've tried to get this working on the digital pins vs the analog. All the examples use the digital, but none of them have ever worked unless I made them all analog.
Again, thank you for any help.
Here are the links to the TFT_22_ILI9225.h wiki as well as Adafruit GFX