-
Notifications
You must be signed in to change notification settings - Fork 0
/
IPS LCD Shield - Green Tab.ino
84 lines (55 loc) · 1.4 KB
/
IPS LCD Shield - Green Tab.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* Unexpected Maker IPS LCD Display shield example
* Adafruit ST7789 Driver Init Example
* Jan 30, 2024
*
*/
#include <Adafruit_GFX.h> // Grab from library Manager
#include <Adafruit_ST7735.h> // Grab from library Manager
#include <SPI.h>
#if defined(ARDUINO_TINYS3)
#define TFT_CS 34
#define TFT_RST -1
#define TFT_DC 3
#define TFT_BACKLIGHT 2
#elif defined(ARDUINO_TINYS2)
#define TFT_CS 14
#define TFT_RST -1
#define TFT_DC 6
#define TFT_BACKLIGHT 5
#else
#define TFT_CS 5
#define TFT_RST -1
#define TFT_DC 15
#define TFT_BACKLIGHT 14
#endif
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
void setup(void)
{
tft.initR(INITR_MINI160x80);
tft.invertDisplay( false );
for ( int i = 0; i < 2; i++ )
{
tft.fillScreen(ST77XX_RED);
delay(200);
tft.fillScreen(ST77XX_GREEN);
delay(200);
tft.fillScreen(ST77XX_BLUE);
delay(200);
}
tft.setTextSize(3);
tft.invertDisplay( true ); // Where i is true or false
tft.fillScreen(ST77XX_BLACK);
tft.setCursor(0, 0);
tft.setTextColor(ST77XX_WHITE, ST77XX_BLACK);
tft.println("Invert\nON\n");
delay(400);
tft.invertDisplay( false ); // Where i is true or false
tft.fillScreen(ST77XX_BLACK);
tft.setCursor(0, 0);
tft.setTextColor(ST77XX_WHITE, ST77XX_BLACK);
tft.println("Invert\nOFF\n");
delay(400);
}
void loop() {
}