#include <SPI.h>
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();
int ysep=90;
int datos [240];
int dataLen=sizeof(datos)/sizeof(datos[0]);
//SPRITE
TFT_eSprite sprSpectre = TFT_eSprite(&tft);
//*/
void getRandomSigStrength(int dataLen){
for (int i=0; i<=dataLen; i++){
datos[i]=random(10,50);
}
}
void drawSprite(){
//sprSpectre.drawFastVline()
}
void setup() {
// put your setup code here, to run once:
tft.init();
tft.setRotation(0);
tft.fillScreen(TFT_BLACK);
//Serial.begin(115200);
// SPRITE
sprSpectre.createSprite(TFT_WIDTH, ysep);
//*/
}
void loop() {
// put your main code here, to run repeatedly:
//tft.drawFastVLine(120, 120, 50, TFT_RED);
//getRandomSigStrength(dataLen); // manda in crash la MCU??? su seriale mi continua a dare "rebooting - error - backtrace..."
for (int i=0; i<=dataLen; i++){
//tft.drawFastVLine(i, 120, random(10,50), TFT_RED);
tft.drawLine(i, 120, i, 120-random(10,50), TFT_RED);
//tft.drawLine(i, 120, i, 120-datos[i], TFT_RED);// niente, perchè con il random richiamato tutte quelle volte si vede che va in crash.
sprSpectre.drawFastVLine(i, 0, 90-random(10,50), TFT_BLUE);
}
sprSpectre.pushSprite(0, 120);
tft.fillScreen(TFT_BLACK);
sprSpectre.fillSprite(TFT_BLACK);
}Loading
ili9341-cap-touch
ili9341-cap-touch