Strange errors with TFT_eSPI
Posted: Wed Jun 02, 2021 1:40 pm
I want to show values an an ESP32 with TFT-Display. The values are stored in an array. The serial monitor shows the correct values, but the TFT display not. all examples are working propperly.
In my code are two errors!!!
1) on every 4th row is a huge value. Why?
If the part in the setup is uncommented, this error disappears.
2) the value on the TFT freezes
Why???
I changed the declaration as long, Pointer as Byte, instead drawNumber i tried drawString(String...). Without success.
Any ideas?[/Codebox]
In my code are two errors!!!
1) on every 4th row is a huge value. Why?
If the part in the setup is uncommented, this error disappears.
2) the value on the TFT freezes
Why???
Code: Select all
int Drehmom[10];
int DrehmomPointer;
#include <TFT_SB_1.h> // own pins
TFT_eSPI tft = TFT_eSPI(); // by Bodemer
void setup() {
tft.init();
tft.fillScreen(TFT_BLACK);
Serial.begin(57600);
/*
Drehmom[0]=0;
Drehmom[1]=0;
Drehmom[2]=0;
Drehmom[3]=0;
Drehmom[4]=0; // 1061177988
Drehmom[5]=0;
Drehmom[6]=0;
Drehmom[7]=0;
Drehmom[8]=0;
Drehmom[9]=0;
*/
}
void loop() {
DrehmomPointer++;
if(DrehmomPointer > 8) {DrehmomPointer=1;}
tft.drawNumber(DrehmomPointer, 100, 80, 6);
//Drehmom[DrehmomPointer] = 5; // stopps at 3
//Drehmom[1] = 5; // ok
//Drehmom[2] = 5; // ok
//Drehmom[3] = 5; // stopps at 1
//Drehmom[4] = 5; // ok
//Drehmom[5] = 5; // ok
//Drehmom[6] = 5; // ok
//Drehmom[7] = 5; // ok
Drehmom[8] = 5; // ok
Drehmom[0] = Drehmom[1] + Drehmom[2] + Drehmom[3] + Drehmom[4] + Drehmom[5] + Drehmom[6] + Drehmom[7] + Drehmom[8] ;
Serial.print(" Pointer: ");Serial.print (DrehmomPointer); Serial.print("\t");
Serial.print(" Drehmom: ");Serial.println(Drehmom[DrehmomPointer]);
delay(50);
}
Any ideas?[/Codebox]