adafruit / Adafruit-ST7735-Library

This is a library for the Adafruit 1.8" SPI display http://www.adafruit.com/products/358 and http://www.adafruit.com/products/618
https://learn.adafruit.com/1-8-tft-display
577 stars 309 forks source link

CircuitPlayground Bluefruit + Gizmo Example Blackscreen #199

Closed mikeysklar closed 6 months ago

mikeysklar commented 6 months ago

graphictest_tft_gizmo.ino Runs for a second on the Adafruit CPB in the default hardware SPI mode then screen goes black. Pressing reset brings up the screen again for a second then back to black. It is the backlight that is turning off. Holding a light to the display you can see the code running.

Changing the code to software SPI works.

// OPTION 1 (recommended) is to use the HARDWARE SPI pins, which are unique
// to each board and not reassignable.
//Adafruit_ST7789 tft = Adafruit_ST7789(spi, TFT_CS, TFT_DC, TFT_RST);

// OPTION 2 lets you interface the display using ANY TWO or THREE PINS,
// tradeoff being that performance is not as fast as hardware SPI above.
#define TFT_MOSI      PIN_WIRE_SDA  // Data out
#define TFT_SCLK      PIN_WIRE_SCL  // Clock out
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

reported by two forum users: forum thread 1 forum thread 2 (duplicate)

Using library Adafruit GFX Library at version 1.11.9 in folder: /Users/sklarm/Documents/Arduino/libraries/Adafruit_GFX_Library 
Using library Adafruit BusIO at version 1.16.0 in folder: /Users/sklarm/Documents/Arduino/libraries/Adafruit_BusIO 
Using library Wire at version 1.0 in folder: /Users/sklarm/Library/Arduino15/packages/adafruit/hardware/nrf52/1.6.1/libraries/Wire 
Using library SPI at version 1.0 in folder: /Users/sklarm/Library/Arduino15/packages/adafruit/hardware/nrf52/1.6.1/libraries/SPI 
Using library Adafruit ST7735 and ST7789 Library at version 1.10.3 in folder: /Users/sklarm/Documents/Arduino/libraries/Adafruit_ST7735_and_ST7789_Library 
Using library Adafruit TinyUSB Library at version 3.1.4 in folder: /Users/sklarm/Documents/Arduino/libraries/Adafruit_TinyUSB_Library 
mikeysklar commented 6 months ago

Resolved. Initializing the display FIRST and then enabling the BACKLIGHT makes the example code run successfully. Code merged.