Permalink
Browse files

update for mini TFT

1 parent 8291069 commit 591fa4165d95c33ba13bfad2f09758852fe1282a @ladyada ladyada committed Jun 22, 2017
@@ -30,7 +30,7 @@ as well as Adafruit raw 1.8" TFT display
// These pins will also work for the 1.8" TFT shield
#define TFT_CS 10
#define TFT_RST 9 // you can also connect this to the Arduino reset
- // in which case, set this #define pin to 0!
+ // in which case, set this #define pin to -1!
#define TFT_DC 8
// Option 1 (recommended): must use the hardware SPI pins
@@ -57,6 +57,9 @@ void setup(void) {
// Use this initializer (uncomment) if you're using a 1.44" TFT
//tft.initR(INITR_144GREENTAB); // initialize a ST7735S chip, black tab
+ // Use this initializer (uncomment) if you're using a 0.96" 180x60 TFT
+ //tft.initR(INITR_MINI160x80); // initialize a ST7735S chip, mini display
+
Serial.println("Initialized");
uint16_t time = millis();
@@ -297,4 +300,4 @@ void mediabuttons() {
tft.fillRoundRect(69, 98, 20, 45, 5, ST7735_RED);
// play color
tft.fillTriangle(42, 20, 42, 60, 90, 40, ST7735_GREEN);
-}
+}
@@ -30,7 +30,7 @@ as well as Adafruit raw 1.8" TFT display
// These pins will also work for the 1.8" TFT shield
#define TFT_CS 10
#define TFT_RST 9 // you can also connect this to the Arduino reset
- // in which case, set this #define pin to 0!
+ // in which case, set this #define pin to -1!
#define TFT_DC 8
// Option 1 (recommended): must use the hardware SPI pins
@@ -54,6 +54,9 @@ void setup(void) {
// Use this initializer (uncomment) if you're using a 1.44" TFT
//tft.initR(INITR_144GREENTAB); // initialize a ST7735S chip, black tab
+ // Use this initializer (uncomment) if you're using a 0.96" 180x60 TFT
+ //tft.initR(INITR_MINI160x80); // initialize a ST7735S chip, mini display
+
Serial.println("init");
tft.setTextWrap(false); // Allow text to run off right edge
@@ -37,7 +37,7 @@ as well as Adafruit raw 1.8" TFT display
#define SD_CS 4 // Chip select line for SD card
//Use this reset pin for the shield!
-//#define TFT_RST 0 // you can also connect this to the Arduino reset!
+//#define TFT_RST -1 // you can also connect this to the Arduino reset!
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
@@ -50,6 +50,9 @@ void setup(void) {
// Use this initializer (uncomment) if you're using a 1.44" TFT
//tft.initR(INITR_144GREENTAB);
+ // Use this initializer (uncomment) if you're using a 0.96" 180x60 TFT
+ //tft.initR(INITR_MINI160x80); // initialize a ST7735S chip, mini display
+
Serial.print("Initializing SD card...");
if (!SD.begin(SD_CS)) {
Serial.println("failed!");

0 comments on commit 591fa41

Please sign in to comment.