I followed the instructions in a HowToMechatronics demo for using a touchscreen display with an Arduino Mega. I altered the code slightly to work for the components I purchased:
- 3.2 inch TFT LCD Display Screen Touch Panel with ILI9341
- 3.3V TFT LCD shield for Arduino Mega
- Arduino Mega
I have the LCD working but the touchscreen only works a third of the time or so. My only solution thus far has been to press the Arduino reset button multiple times until the touchscreen works properly. The display should be in Landscape mode. Details on the libraries used can be found in the link above. Any ideas on what to fix?
The only adjustment made to the original code was to eliminate the flappy birds portion and alter the screen objects as shown below. The code is a little long so it is attached to the post.
UTFT myGLCD(ILI9341_16,38,39,40,41); //Parameters should be adjusted to your Display/Schield model
URTouch myTouch( 6, 5, 4, 3, 2);
LCD_Tutorial.ino (11.9 KB)