Skip to content

Commit 56c0a78

Browse files
committed
image upload: add support for cplay bluefruit + tft gizmo
1 parent be18594 commit 56c0a78

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

libraries/Bluefruit52Lib/examples/Peripheral/image_upload/image_upload.ino

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,25 @@
4040
#define TFT_CS 9
4141
#endif
4242

43+
// Circuit Playground Bluefruit for use with TFT 1.5" GIZMO
4344
#ifdef ARDUINO_NRF52840_CIRCUITPLAY
44-
#define TFT_DC A7
45-
#define TFT_CS A6
45+
#define TFT_DC 1
46+
#define TFT_CS 0
47+
#define TFT_BACKLIGHT A3
4648
#endif
4749

4850
#if TFT_IN_USE == TFT_35_FEATHERWING
4951
#include "Adafruit_HX8357.h"
5052
Adafruit_HX8357 tft = Adafruit_HX8357(TFT_CS, TFT_DC);
53+
5154
#elif TFT_IN_USE == TFT_24_FEATHERWING
5255
#include <Adafruit_ILI9341.h>
5356
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
57+
5458
#elif TFT_IN_USE == TFT_15_GIZMO
55-
#error "Not supported yet"
59+
#include "Adafruit_ST7789.h"
60+
Adafruit_ST7789 tft = Adafruit_ST7789(&SPI, TFT_CS, TFT_DC, -1);
61+
5662
#else
5763
#error "TFT display is not supported"
5864
#endif
@@ -99,7 +105,17 @@ void setup()
99105
{
100106
Serial.begin(115200);
101107

108+
#if TFT_IN_USE == TFT_15_GIZMO
109+
tft.init(240, 240);
110+
tft.setRotation(2);
111+
pinMode(TFT_BACKLIGHT, OUTPUT);
112+
digitalWrite(TFT_BACKLIGHT, HIGH); // Backlight on
113+
114+
#else
102115
tft.begin();
116+
117+
#endif
118+
103119
tft.fillScreen(COLOR_BLACK);
104120
tft.setTextColor(COLOR_WHITE);
105121
tft.setTextSize(1);

0 commit comments

Comments
 (0)