If this appears to be not working or broken with a blank screen, then possibly the driver library is not quite right.
Jaycar now have a custom build of libraries on their website, which works fine. Download the file, and follow the instructions in the "XC4630 Notes.txt" file. These drivers and examples work fine for me.
Unfortunately this wasn't available last year when I was trying to first get it working. (I was just sitting down now to write up what you can do, but see that it's all much easier now).
The Jaycar libraries are based on the Adafruit libraries, which are hosted in GitHub. For posterity (or if you want to use a more up to date version of the libraries), I had to do the following to get them to work.
1. Download the libraries
- Adafruit GFX Library (zip download)
- Adafruit TFTLCD Library (zip download)
- Adafruit Touch Screen Library (zip download)
2. Import the libraries into the Arduino software
- Sketch | Include Library | Add .ZIP Library... (once for each)
3. Open an example
- File | Examples | TFTLCD-Library-master | graphicstest
4. Fix the hardware identifier
This is the bit that took a while to figure out. For reference, the serial number on my TFT LCD is: QR4 5265S01 G3/2 TP28017.
- It seems that the readID() function in the Adafruit library does not work with this particular hardware.
- In the example graphicstest program, Locate line 60: uint16_t identifier = tft.readID();
- Change it to: uint16_t identifier = 0x9341;
- Or, equivalently, change line 84 to: tft.begin(0x9341);
The tftpaint program also worked for me with a similar change.
Hope this helps someone.
8 comments:
Awesome mate, this did the trick
this definitely helped me! thank you so much
This helped me a lot. Thankks
Hi guys,
Thanks for the write up. I am having some issues still. After changing the code at line 60 I still seem to have a white screen for the graphicstest example through the XC4036 folder.
My serial number on the screen has G3/1 rather than G3/2... any idea how I would go about finding the right identifier?
I finally got the paint touch function working using this demonic screen that has little to no help in the provided with it from the retailer. Had to use the Adafruit library example tftpaint with the following modifications. If this doesnt work I suggest calling an exorcist
1. Force to screen type by adding this at Row 93
identifier=0x9325
2. Reverse Y touch scale.
// p.y = map(p.y, TS_MINY, TS_MAXY, tft.height(), 0); Original Code
p.y = map(p.y, TS_MAXY, TS_MINY, tft.height(), 0); // Reversed polarity of touch
3. Re calibrate touch location
#define TS_MINX 90
#define TS_MINY 60
#define TS_MAXX 920
#define TS_MAXY 930
Our TFT-LCD displays have a backlight lifetime ranging from 20-100 thousand hours depending on the size of the monitor and other factors. For more information on all of our TFT-LCD products. Click here Our website https://www.stoneitech.com/
With some of the ADAFRUIT sketches where you can specify the 2.8" screen type:
identifier=0x9325
works - as does:
identifier=0x9328
The 2.8" screen type that I was using was 0x8230
I have found a better solution is to use the MCUFRIEND_kbv library and examples. They worked for me without change - I think they are brand agnostic. I suggest getting the library MCUFRIEND_kbv-master (available on GITHUB) and install instead of Adafruit.
I am happy to this blog site giving one-of-a-kind and also useful knowledge concerning this topic. Click to view the site
Post a Comment