Teensy 3.2 with ST7789

Status
Not open for further replies.

bsandipk

Member
I am using T3.2 and ST7789 (240240 IPS no CS) https://smile.amazon.com/gp/product/B07P9X3L7M/ref=ppx_yo_dt_b_asin_title_o02_s00?ie=UTF8&psc=1

Here is the code

/#include <Adafruit_GFX.h>
//#include <ST7735_t3.h> // Hardware-specific library
#include <ST7789_t3.h> // Hardware-specific library
#include <SPI.h>
#include <st7735_t3_font_ComicSansMS.h>

#define TFT_MISO 12
#define TFT_MOSI 11 //a12
#define TFT_SCK 13 //a13
#define TFT_DC 9
#define TFT_CS -1 //10 there is no CS
#define TFT_RST 8

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
ST7789_t3 tft = ST7789_t3(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCK, TFT_RST);

// If using the breakout, change pins as desired
//Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);

void setup() {

Serial.begin(9600);
tft.init(240, 240, SPI_MODE2); // Init ST7789 320x240
tft.setRotation(3);
tft.useFrameBuffer(true);
//tft.fillScreen(ST7735_WHITE);
// while (!Serial) ;
tft.setTextColor(ST7735_BLACK);
tft.fillScreen(ST7735_BLACK);
// tft.drawLine(120,0,120,240,ST7735_WHITE);
tft.setScrollTextArea(0,0,120,200);
tft.setScrollBackgroundColor(ST7735_BLACK);
tft.enableScroll();
tft.updateScreen();
tft.setFont(ComicSansMS_40);
// tft.setTextSize(5);
tft.setCursor(1, 1);
tft.setTextColor(ST7735_WHITE);
/* for(int i=0;i<20;i++){
tft.print(" this is line ");
tft.println(i);
tft.updateScreen();
delay(500);
}
*/

}

void loop(void) {
tft.println(millis()/1000);
//tft.updateScreen();
delay(1000);
}

The issue is after 4 lines it shows vertical colored lines, and does not scroll the text up - attached pix. Am I missing something?

IMG_4821.jpg
 
Status
Not open for further replies.
Back
Top