File tree Expand file tree Collapse file tree 3 files changed +6
-25
lines changed
examples/Adafruit_ST7789/graphicstest_st7789 Expand file tree Collapse file tree 3 files changed +6
-25
lines changed Original file line number Diff line number Diff line change 33
33
#include < SPI.h>
34
34
#include < Fri3dBadge_Adafruit_ST7789.h>
35
35
36
- #if defined(ARDUINO_FEATHER_ESP32) // Feather Huzzah32
37
- #define TFT_CS 14
38
- #define TFT_RST 15
39
- #define TFT_DC 32
40
-
41
- #elif defined(ESP8266)
42
- #define TFT_CS 4
43
- #define TFT_RST 16
44
- #define TFT_DC 5
45
-
46
- #else
47
- // For the breakout board, you can use any 2 or 3 pins.
48
- // These pins will also work for the 1.8" TFT shield.
49
- #define TFT_CS 10
50
- #define TFT_RST 9 // Or set to -1 and connect to Arduino RESET pin
51
- #define TFT_DC 8
52
- #endif
53
-
54
36
// OPTION 1 (recommended) is to use the HARDWARE SPI pins, which are unique
55
37
// to each board and not reassignable. For Arduino Uno: MOSI = pin 11 and
56
38
// SCLK = pin 13. This is the fastest mode of operation and is required if
@@ -73,7 +55,7 @@ void setup(void) {
73
55
Serial.print (F (" Hello! ST77xx TFT Test" ));
74
56
75
57
// Use this initializer (uncomment) if using a 1.3" or 1.54" 240x240 TFT:
76
- tft.init (240 , 240 ); // Init ST7789 240x240
58
+ tft.init (X_LCD_HEIGHT, X_LCD_WIDTH ); // Init ST7789 240x240
77
59
78
60
// OR use this initializer (uncomment) if using a 1.69" 280x240 TFT:
79
61
// tft.init(240, 280); // Init ST7789 280x240
Original file line number Diff line number Diff line change @@ -5,9 +5,8 @@ Fri3dBadge_Adafruit_ST7789::Fri3dBadge_Adafruit_ST7789() : Adafruit_ST7789(X_LCD
5
5
6
6
}
7
7
8
- void Fri3dBadge_Adafruit_ST7789::begin ( uint32_t freq )
8
+ void Fri3dBadge_Adafruit_ST7789::init ( )
9
9
{
10
10
// Call the parent class's begin method to initialize the display
11
- Adafruit_ST7789::begin (freq);
12
- setRotation (1 );
11
+ Adafruit_ST7789::init (X_LCD_WIDTH, X_LCD_HEIGHT);
13
12
}
Original file line number Diff line number Diff line change 1
- #ifndef Fri3dBadge_TFT_h
2
- #define Fri3dBadge_TFT_h
1
+ #ifndef Fri3dBadge_Adafruit_ST7789
2
+ #define Fri3dBadge_Adafruit_ST7789
3
3
4
4
#include < Adafruit_GFX.h> // Core graphics library
5
5
#include < Adafruit_ST7789.h> // Hardware-specific library for ST7789
14
14
15
15
class Fri3dBadge_Adafruit_ST7789 : public Adafruit_ST7789 {
16
16
public:
17
- Fri3dBadge_TFT ();
17
+ Fri3dBadge_Adafruit_ST7789 ();
18
18
private:
19
19
20
20
};
You can’t perform that action at this time.
0 commit comments