Serial.println(F("Also if using the breakout, double-check that all wiring")) Serial.println(F("If using the breakout board, it should NOT be #defined!")) Serial.println(F("should appear in the library header (Adafruit_TFT.h).")) Serial.println(F(" #define USE_ADAFRUIT_SHIELD_PINOUT")) Serial.println(F("If using the Adafruit 2.4\" TFT Arduino shield, the line:"))
Serial.print(F("Unknown LCD driver chip: ")) Serial.println(F("Found HX8357D LCD driver")) Serial.println(F("Found ILI9341 LCD driver")) Serial.println(F("Found HX8347G LCD driver")) Serial.println(F("Found ILI9328 LCD driver")) Serial.println(F("Found ILI9325 LCD driver")) Serial.println(F("Using Adafruit 2.4\" TFT Breakout Board Pinout")) Serial.println(F("Using Adafruit 2.4\" TFT Arduino Shield Pinout")) TSPoint p = ts.getPoint() stores the length (x), width (y) and compression (z) in the p object.ĭisplaying Text and Shapes on Arduino 2.4 LCD /*Īdafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET) Serial.print("\tPressure = ") Serial.println(p.z) Serial.print("\tY = ") Serial.print(p.y)
TouchScreen ts = TouchScreen(XP, YP, XM, YM, 300) For the one we're using, its 300 ohms across the X plate between X+ and X- Use any multimeter to read it For better pressure precision, we need to know the resistance You can use this coordination in any other project.
Then touch your desired location and write the coordinates displayed on the serial monitor. To do so, you should upload the following code on your Arduino board and open the serial monitor. If you are about to use the LCD, you need to know the coordinates of the point you touch. If (p.z > MINPRESSURE & p.One of the most important features of this LCD is including a touch panel. Create black rectangle to clear the previous millis() text and print new Tft.fillRect(0, xplace, BOXSIZE, BOXSIZE, YELLOW) Tft.fillRect(xplace, 0, BOXSIZE, BOXSIZE, YELLOW)
Tft.fillRect(0, xplace, BOXSIZE, 1, BLACK) Tft.fillRect(xplace, 0, 1, BOXSIZE, BLACK) small loop that creates two moving boxes P.y = map(p.y, TS_MINY, TS_MAXY, tft.height(), 0) P.x = map(p.x, TS_MINX, TS_MAXX, tft.width(), 0) If (p.z > MINPRESSURE & p.z 1023 to tft.width we have some minimum pressure we consider 'valid' if sharing pins, you'll need to fix the directions of the touchscreen pins Serial.println(F("matches the tutorial.")) Serial.println(F("If using the Adafruit 2.8\" TFT Arduino shield, the line:")) Serial.println(F("Found LGDP4535 LCD driver"))
This part helps to identify the type of LCD driver you have. Assign human-readable names to some common 16-bit color values:Īdafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET) The unit came in an anti-static bag as shown in the pictures with a stylus and NO documentation. TouchScreen ts = TouchScreen(XP, YP, XM, YM, 310) UNO R3 2.8 TFT Touch Screen With SD Card Socket for Arduino Board Module: Trying to get this touch screen display working has caused some people frustration. For the one we're using, its 300 ohms across the X plate in our case A2 and digital pin 8. #define XM A2 // must be an analog pin, use "An" notation! #define YP A3 // must be an analog pin, use "An" notation! Lets include the libraries and define the constants:.Download 2.5 inch tft touch library from:, and or all from one place + examples HERE.
Full sketch and library downloads included.
So today we going to look how to set up 2.4 TFT LCD display on arduino.