Skip to content

Commit c002885

Browse files
Fix Fri3dBadge_Adafruit_ST7789 old code and wrong method use
1 parent a527c93 commit c002885

File tree

3 files changed

+6
-25
lines changed

3 files changed

+6
-25
lines changed

libraries/Fri3dBadge/examples/Adafruit_ST7789/graphicstest_st7789/graphicstest_st7789.ino

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,6 @@
3333
#include <SPI.h>
3434
#include <Fri3dBadge_Adafruit_ST7789.h>
3535

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-
5436
// OPTION 1 (recommended) is to use the HARDWARE SPI pins, which are unique
5537
// to each board and not reassignable. For Arduino Uno: MOSI = pin 11 and
5638
// SCLK = pin 13. This is the fastest mode of operation and is required if
@@ -73,7 +55,7 @@ void setup(void) {
7355
Serial.print(F("Hello! ST77xx TFT Test"));
7456

7557
// 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
7759

7860
// OR use this initializer (uncomment) if using a 1.69" 280x240 TFT:
7961
//tft.init(240, 280); // Init ST7789 280x240

libraries/Fri3dBadge/src/Fri3dBadge_Adafruit_ST7789.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ Fri3dBadge_Adafruit_ST7789::Fri3dBadge_Adafruit_ST7789() : Adafruit_ST7789(X_LCD
55

66
}
77

8-
void Fri3dBadge_Adafruit_ST7789::begin(uint32_t freq)
8+
void Fri3dBadge_Adafruit_ST7789::init()
99
{
1010
// 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);
1312
}

libraries/Fri3dBadge/src/Fri3dBadge_Adafruit_ST7789.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef Fri3dBadge_TFT_h
2-
#define Fri3dBadge_TFT_h
1+
#ifndef Fri3dBadge_Adafruit_ST7789
2+
#define Fri3dBadge_Adafruit_ST7789
33

44
#include <Adafruit_GFX.h> // Core graphics library
55
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789
@@ -14,7 +14,7 @@
1414

1515
class Fri3dBadge_Adafruit_ST7789 : public Adafruit_ST7789 {
1616
public:
17-
Fri3dBadge_TFT();
17+
Fri3dBadge_Adafruit_ST7789();
1818
private:
1919

2020
};

0 commit comments

Comments
 (0)