#include // Core graphics library #include // Hardware-specific library #define LCD_CS A3 // Chip Select goes to Analog 3 #define LCD_CD A2 // Command/Data goes to Analog 2 #define LCD_WR A1 // LCD Write goes to Analog 1 #define LCD_RD A0 // LCD Read goes to Analog 0 #define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin // Assign human-readable names to some common 16-bit color values: // With Changes for inversion !! #define BLACK 0xFFFF #define BLUE 0xFFE0 #define GREEN 0xF81F #define CYAN 0xF800 #define GRAY1 0x8410 #define RED 0x07FF //define BRIGHT_RED 0x???? #define GRAY2 0x4208 #define MAGENTA 0x07E0 #define YELLOW 0x001F #define WHITE 0x0000 Adafruit_ILI9341_8bit_AS tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); void setup() { } void loop() { // find the TFT display digitalWrite uint16_t identifier = tft.readRegister(0x0); if (identifier == 0x9325) { Serial.println("Found ILI9325"); } else if (identifier == 0x9328) { Serial.println("Found ILI9328"); } else { Serial.print("Unknown driver chip "); Serial.println(identifier, HEX); while (1); } }