- Code: Select all
void setup(void) {
tft.initR(INITR_GREENTAB); // initialize a ST7735R chip, green tab
lcd.begin(20, 4);
SD.begin(SD_CS);
tft.fillScreen(ST7735_BLACK);
lcd.setCursor(3,0);
lcd.print("English Project");
lcd.setCursor(3,2);
lcd.print("Alex Kelleher");
delay(3000);
lcd.clear();
}
void loop() {
drawGlee();
drawDelight();
drawCheerful();
drawGlad();
drawImpartial();
drawLament();
}
void drawGlee(){
bmpDraw("glee.bmp",0,0);
lcd.clear();
lcd.setCursor(8,0);
lcd.print("Glee");
lcd.setCursor(2,2);
lcd.print("Great delight or");
lcd.setCursor(6,3);
lcd.print("pleasure");
delay(3000);
}
drawDelight(), drawCheerful(), etc. all follow the same format as drawGlee(); bmpDraw() is copied from the example in the ST7735 library.
This code works fine. It displays the initial nameplate with a black TFT, and then cycles through the six words with their corresponding images.
The problem comes when I add one more word. If I add
- Code: Select all
void drawDejection(){
bmpDraw("dejection.bmp",0,0);
lcd.clear();
lcd.setCursor(4,0);
lcd.print("Dejection");
lcd.setCursor(1,2);
lcd.print("Lowness of spirits");
delay(3000);
}
and call it from loop() right after the others, it breaks. All it does is show the nameplate with the black TFT, and then the character LCD clears, and then nothing else happens. But if I get rid of drawDejection(), it works fine again.
I'm really clueless about why this is happening. Thanks in advance.

