2.4 Inch TFT Touch Screen LCD Error conflicting return type specified for 'virtu

Hi!

I am a newbie and got a 2.4 inch TFT LCD touch screen, seller gave me the library with Arduino IDE. I run the 0022 IDE and it works fine.

But I copied the TFTLCD library into Arduino IDE 1.6.5 libraries folder and run "graphicstest.pde", then I got the error below.

Error Message from IDE

Arduino: 1.6.5 (Windows 8.1), Board: "Arduino/Genuino Uno"

In file included from graphicstest.ino.ino:18:0:
C:\Program Files (x86)\Arduino\libraries\TFTLCD/TFTLCD.h:99:16: error: conflicting return type specified for 'virtual void TFTLCD::write(uint8_t)'
virtual void write(uint8_t);
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:224,
from C:\Program Files (x86)\Arduino\libraries\TFTLCD/TFTLCD.h:3,
from graphicstest.ino.ino:18:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:48:20: error: overriding 'virtual size_t Print::write(uint8_t)'
virtual size_t write(uint8_t) = 0;
^
Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

End*

Hope someone could help.

Thanks in advanced.

Kevin

0022 IDE.jpg

TFTLCD.h (4.91 KB)

I suggest that you use Adafruit_TFTLCD.h and Adafruit_GFX.h instead of the old TFTLCD library.

There are some small differences between v0022 and v1.6.5 e.g. the type of write() method.
Most current libraries detect whether you are using the obsolete 0022 or a v1.x.x release.

The other problem is data that is located in Flash memory. The current C++ compiler requires you to add const to every PROGMEM item.

In practice, just download and install current versions of a library. With luck, the authors have already sorted out the const and write() issues.

David.

Thanks for your reply David!

Adafruit_TFTLCD.h and Adafruit_GFX.h I used these on v1.6.5, it did comply but the LCD shows white screen after I uploaded the graphicstest example.

Is it possible to change the library to work with v1.6.5?

I attached the TFTLCD.h and TFTLCD.cpp file.

Take care!

Kevin

TFTLCD.cpp (20.9 KB)

TFTLCD.h (4.85 KB)

Well, the <Adafruit_TFTLCD.h> library is different to the <TFTLCD.h> library.

However the code that you have posted is TFTLCD. If you have an McuFriend shield, you should uncomment the

//#define USE_ADAFRUIT_SHIELD_PINOUT

because the data bus uses the ADAFRUIT_SHIELD wiring.

Likewise, if you use the "better organised" Adafruit_TFTLCD library, you also need to define USE_ADAFRUIT_SHIELD_PINOUT

If your shield has been working with TFTLCD.h it probably has an ILI9325 controller. Run the example sketches and it will tell you which controller it has found.

David.

Hello again!

I do have a MCUFriend display...

I ran the example code after uncomment

//#define USE_ADAFRUIT_SHIELD_PINOUT

I still got same error and white screen too even with Adafruit's library.

About the chip, I am not sure from reading below example code, it should be ILI9325??

*** Code ***

tft.reset();

uint16_t identifier = tft.readRegister(0x0);
if (identifier == 0x9325) {
Serial.println("Found ILI9325");
} else if (identifier == 0x9328) {
Serial.println("Found ILI9328");
} else {
Serial.print("Unknown driver chip ");
Serial.println(identifier, HEX);

End

Thanks for your help!

Kevin

Adafruit_TFTLCD.h (3.06 KB)

Adafruit_TFTLCD.cpp (28.1 KB)

I have never seen that particular pcb.
At a wild guess it will have a Renesas R61505 controller. What does the Adafruit example Sketch say?

David.

It says as attached picture ( BTW, I don't know why i can't copy this from serial port.)

I think you are right as the board has "1505 UNO" silk print.

20150914214144.jpg

Well, for a start you are not using the USE_ADAFRUIT_SHIELD_PINOUT macro.
Edit the Adafruit_TFTLCD.h file to uncomment the #define.

Then run the example programs. 0xC505 is not an appropriate ID.
As far as I can see, a R61505 will have an ID of 0x1505
a R61505V will have an ID of 0xB505

If you have either of these controllers, it should be pretty simple to get you going.
I do not have either controller but we could exchange emails. i.e. I send you a library. You report back with the results.

David.

sure, please send the library to wingmywings@yeah.net,

Kevin