#include // Core graphics library #include // Hardware-specific library // 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). #define LCD_CS A3 // Chip Select goes to Analog 3 #define LCD_CD A2 // Command/Data goes to Analog 2, Labled LCD_RS #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: // Set for inverted color display. #define BLACK 0xFFFF //65523-65535 #define BLUE 0xFFE0 //65504-65522 #define BRIGHTBLUE 0xFD20 #define GREEN 0xF81F #define CYAN 0xF800 #define LIGHTBLUE 0xF400 #define BLUE2 0xAFE5 #define GRAY1 0x8410 #define RED 0x07FF //define BRIGHT_RED 0x???? #define GRAY2 0x4208 #define WHITE3 0x1000 #define W+PINK4 0x0D00 #define W+PINK3 0x0C00 #define W+PINK2 0x0B00 #define W+PINK 0x0A00 #define WHITE2 0x0800 #define MAGENTA 0x07E0 #define PINK3 0x0500 #define PINK2 0x0400 #define PINK 0x03E0 #define YELLOW 0x001F //11-32 #define WHITE 0x0000 #define TESTCOL 0xF71F Adafruit_ILI9341_8bit_AS tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET); void setup() { tft.reset(); delay(10); tft.begin(0x9341); tft.fillScreen(BLACK); } void loop() { tft.fillScreen(BLACK); tft.fillRect(0, 0, 239, 40,BLACK); tft.fillRect(0, 40, 239, 40,BLUE); tft.fillRect(0, 80, 239, 40,RED); tft.fillRect(0, 120, 239, 40,MAGENTA); tft.fillRect(0, 160, 239, 40,GREEN); tft.fillRect(0, 200, 239, 40,CYAN); tft.fillRect(0, 240, 239, 40,YELLOW); tft.fillRect(0, 280, 239, 40,WHITE); delay(5000); } /********************************************************************************************************* END FILE *********************************************************************************************************/