IDUINO for maker’s life User Manual For 2.8" TFT Touch Shield for Arduino with Resistive Touch Screen (TF028) www.openplatform.
IDUINO for maker’s life Description: This 2.8” TFT Touchscreen is designed to suitable for Arduino UNO/Mega2560. It can directly plug inoto the UNO/Mega2560 board without any wiring and soldering. Library is compatible with Adafruit TFT touchscreen shield, which is easy to use . It has way more resolution than a black and white 128x64 display. As a bonus, this display has a resistive touchscreen attached to it already, so you can detect finger presses anywhere on the screen.
IDUINO for maker’s life Pinout PIN LCD_RST LCD_CS LCD_RS LCD_WR LCD_RD GND 5V 3V3 LCD_D0 LCD_D1 LCD_D2 LCD_D3 LCD_D4 LCD_D5 LCD_D6 LCD_D7 Description LCD Reset pin LCD Chip select LCD Register select LCD Write LCD Read Ground 5V 3.3V LCD data bit 0 LCD data bit 1 LCD data bit 2 LCD data bit 3 LCD data bit 4 LCD data bit 5 LCD data bit 6 LCD data bit 7 www.openplatform.
IDUINO for maker’s life SD_SS SD_DI SD_DO SD_SCK SD card SD card SD card SD card Slave select Serial data In Serial data Out Serial clock Example: We have several cool projects as the example, such as text display, phone call and image display. Here we use the phone call to show. Before uploading the code, you need install the library first. And no wire connection is needed, just plug the Screen module on the UNO/Mega board. www.openplatform.
IDUINO for maker’s life *******code begin******* #include // Core graphics library #include // Hardware-specific library #include // The control pins for the LCD can be assigned to any digital or // analog pins...but we'll use the analog pins as this allows us to // double up the pins with the touch screen (see the TFT paint example).
IDUINO for maker’s life #define RED 0xF800 #define GREEN 0x07E0 #define CYAN 0x07FF #define MAGENTA 0xF81F #define YELLOW 0xFFE0 #define WHITE 0xFFFF // Color definitions #define ILI9341_BLACK 0x0000 /* 0, 0, #define ILI9341_NAVY 0x000F /* 0, 0, 128 */ #define ILI9341_DARKGREEN 0x03E0 /* 0, 128, #define ILI9341_DARKCYAN 0x03EF /* 0, 128, 128 */ #define ILI9341_MAROON 0x7800 /* 128, 0, #define ILI9341_PURPLE 0x780F /* 128, 0, 128 */ #define ILI9341_OLIVE 0x7BE0 /* 128, 1
IDUINO for maker’s life // the data (phone #) we store in the textfield #define TEXT_LEN 12 char textfield[TEXT_LEN+1] = ""; uint8_t textfield_i=0; #define YP A3 // must be an analog pin, use "An" notation! #define XM A2 // must be an analog pin, use "An" notation! #define YM 9 // can be a digital pin #define XP 8 // can be a digital pin #define TS_MINX 100 #define TS_MAXX 920 #define TS_MINY 70 #define TS_MAXY 900 // We have a status line for like, is FONA working #define STATUS_X 10 #define STATUS_Y 6
IDUINO for maker’s life #else Serial.println(F("Using Adafruit 2.4\" TFT Breakout Board Pinout")); #endif Serial.print("TFT size is "); Serial.print(tft.width()); Serial.print("x"); Serial.println(tft.height()); tft.reset(); uint16_t identifier = tft.readID(); if(identifier == 0x9325) { Serial.println(F("Found ILI9325 LCD driver")); } else if(identifier == 0x9328) { Serial.println(F("Found ILI9328 LCD driver")); } else if(identifier == 0x4535) { Serial.
IDUINO for maker’s life tft.begin(identifier); tft.setRotation(0); tft.fillScreen(BLACK); // create buttons for (uint8_t row=0; row<5; row++) { for (uint8_t col=0; col<3; col++) { buttons[col + row*3].initButton(&tft, BUTTON_X+col*(BUTTON_W+BUTTON_SPACING_X), BUTTON_Y+row*(BUTTON_H+BUTTON_SPACING_Y), // x, y, w, h, outline, fill, text BUTTON_W, BUTTON_H, ILI9341_WHITE, buttoncolors[col+row*3], ILI9341_WHITE, buttonlabels[col + row*3], BUTTON_TEXTSIZE); buttons[col + row*3].
IDUINO for maker’s life digitalWrite(13, HIGH); TSPoint p = ts.getPoint(); digitalWrite(13, LOW); // if sharing pins, you'll need to fix the directions of the touchscreen pins //pinMode(XP, OUTPUT); pinMode(XM, OUTPUT); pinMode(YP, OUTPUT); //pinMode(YM, OUTPUT); // we have some minimum pressure we consider 'valid' // pressure of 0 means no pressing! // p = ts.getPoint(); /* if (ts.bufferSize()) { } else { // this is our way of tracking touch 'release'! p.x = p.y = p.
IDUINO for maker’s life } } // now we can ask the buttons if their state has changed for (uint8_t b=0; b<15; b++) { if (buttons[b].justReleased()) { // Serial.print("Released: "); Serial.println(b); buttons[b].drawButton(); // draw normal } if (buttons[b].justPressed()) { buttons[b].
IDUINO for maker’s life //fona.hangUp(); } // we dont really check that the text field makes sense // just try to call if (b == 0) { status(F("Calling")); Serial.print("Calling "); Serial.print(textfield); //fona.callPhone(textfield); } delay(100); // UI debouncing } } } *******code End******* Upload the code, you’ll see the display as follow: Reference https://learn.adafruit.com/arduin-o-phone-arduino-powered-diy-cellphone www.openplatform.