1
+
2
+ #include < Adafruit_TFTLCD.h> // Hardware-specific library
3
+ #include < Adafruit_GFX.h> // Core graphics library
4
+ #include " serialDisplay.h"
5
+
6
+ // TFT_eSPI tft = TFT_eSPI(); // Invoke custom library
7
+
8
+ // The control pins for the LCD can be assigned to any digital or
9
+ // analog pins...but we'll use the analog pins as this allows us to
10
+ // double up the pins with the touch screen (see the TFT paint example).
11
+ #define LCD_CS A3 // Chip Select goes to Analog 3
12
+ #define LCD_CD A2 // Command/Data goes to Analog 2
13
+ #define LCD_WR A1 // LCD Write goes to Analog 1
14
+ #define LCD_RD A0 // LCD Read goes to Analog 0
15
+ #define LCD_RESET A4 // Can alternately just connect to Arduino's reset pin
16
+ Adafruit_TFTLCD tft (LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
17
+
18
+ // Using two fonts since numbers are nice when bold
19
+ // #define LABEL1_FONT &FreeSansOblique12pt7b // Key label font 1
20
+ // #define LABEL2_FONT &FreeSansBold12pt7b // Key label font 2
21
+
22
+
23
+ serialDisplay sDisplay (&tft);
24
+
25
+ // ------------------------------------------------------------------------------------------
26
+
27
+ void setup () {
28
+ Serial.begin (9600 );
29
+
30
+ tft.begin ();
31
+ tft.setRotation (0 );
32
+
33
+ // tft.setFreeFont(LABEL2_FONT);
34
+
35
+ // Buffer Limit from the Serial Monitor is 64 bytes
36
+ sDisplay .runCommands (" x;ts2;sc10,10;#17e0;thDisplay Prototyping;" );
37
+ sDisplay .runCommands (" sc10,30;ts1;thLibrary v1.0;" );
38
+ sDisplay .runCommands (" sc10,10;tvVertical Center;sc10,80;ttNormal text;" );
39
+ sDisplay .runCommands (" #f804;ch20,60,10;#ffe0;cf50,60,10;" );
40
+ sDisplay .runCommands (" #05ff;gh70,50,90,60,70,70;#ffff;gf100,50,120,60,100,70;" );
41
+ sDisplay .runCommands (" #fc7c;rh130,50,20,20;#263c;rf160,50,20,20;#efe0;ri10,100,40,40,10;" );
42
+ sDisplay .runCommands (" #f9e0;rj60,100,40,40,13;#1f9d;lv2,45,280;#07ff;lh2,170,240;" );
43
+ sDisplay .runCommands (" #ded8;dl2,170,240,320;" );
44
+ // // Clear the screen
45
+ // tft.fillScreen(TFT_BLACK);
46
+
47
+ // // Draw keypad background
48
+ // tft.fillRect(0, 0, 240, 320, TFT_DARKGREY);
49
+
50
+ // // Draw number display area and frame
51
+ // tft.fillRect(DISP_X, DISP_Y, DISP_W, DISP_H, TFT_BLACK);
52
+ // tft.drawRect(DISP_X, DISP_Y, DISP_W, DISP_H, TFT_WHITE);
53
+
54
+ // // Draw keypad
55
+ // drawKeypad();
56
+ }
57
+
58
+ void loop (void ) {
59
+
60
+ sDisplay .readCommandsFromSerial ();
61
+ }
0 commit comments