Viewable With Any Browser

STATS

Todays date:
Saturday 12th of October 2024 08:11:16 PM

You are visitor

21103


Your IP address is 44.192.95.161


Page last updated
8 June 2018

Testing the display

Arduino     The fastest display example we have found so far is the Adafruit one.

Make sure you have the Adafruit_GFX and Adafruit_ILI9341 libraries installed.

Open the Arduino IDE and go to File - Examples - Adafruit ILI9341 and open the graphicstest example.

Scroll down to the lines:

// For the Adafruit shield, these are the default.
#define TFT_DC 9
#define TFT_CS 10


And change them to:

// For the Seeed shield v2.0, these are the default.
#define TFT_DC 6
#define TFT_CS 5


Upload the sketch and marvel at the speed.

Testing the touch

Arduino     Make sure you have the Adafruit TouchScreen library installed.

Open the Arduino IDE and go to File - Examples - Adafruit TouchScreen and open the touchscreendemo example.

Scroll down to the lines:

#define YP A2 // must be an analog pin, use "An" notation!
#define XM A3 // must be an analog pin, use "An" notation!
#define YM 8 // can be a digital pin
#define XP 9 // can be a digital pin


And change them to:

#define YP A2 // must be an analog pin, use "An" notation!
#define XM A1 // must be an analog pin, use "An" notation!
#define YM A0 // can be a digital pin
#define XP A3 // can be a digital pin


Upload the sketch and open the serial monitor. Touch.

Testing the Micro SD card

Arduino     Here we will use two concepts to test the SD card.

The SD card uses SPI to read and write data.

We will initialize the card slot and draw a Bitmap image to the TFT screen, to show us that it worked.



Make sure you have the Adafruit_GFX and Adafruit_ILI9341 libraries installed.

You will also need a sample image copied to the SD card. Adafruit have a sample image called 'purple.bmp'. Use this link and follow the instructions to get the file.

Download purple.bmp   

Next, open the Arduino IDE and go to File - Examples - Adafruit ILI9341 and open the spitftbitmap example.

Scroll down to the lines:

#define TFT_DC 9
#define TFT_CS 10


And change them to:

#define TFT_DC 6
#define TFT_CS 5


Upload the sketch and check the image is drawn to the TFT.

The example should draw a small version of the image, then a large version, then another small version.
It will then rotate the screen by ninety degrees, and draw again.

Open the serial monitor to see debug information.

so far so good

I hope you found these examples useful. They have introduced the building blocks to get this particular TFT Touch screen to work.

Next, I will try to do something useful with my TFT.

>>next>>