test — ESP32 simulation

An interactive ESP32 circuit simulation you can run free in your browser on Velxio, by xlorere.

Components

Sketch code

#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#define TFTcs 15
#define TFTdc 21
#define TFTrst 19
#define knop1 23
Adafruit_ST7735 tft(TFTcs, TFTdc, TFTrst);
bool ready = true;
int schet = 0;
void setup(){
    pinMode(TFTcs, OUTPUT);
    pinMode(TFTdc, OUTPUT);
    pinMode(TFTrst, OUTPUT);
    pinMode(knop1, INPUT_PULLUP);
    digitalRead (25);
    SPI.begin(18, 5, 4, 15);
    tft.initR(INITR_BLACKTAB);
    tft.fillScreen(0x0000);
    tft.setRotation(2);
    tft.setCursor(0, 50);
    tft.setTextColor(0xFFFF);
    tft.setTextSize(2);
    int i = 0;
    while ( i < 100){
        i= i + 20;
        tft.setCursor(0, 50);
        tft. print("Please wait...");
        tft.print(i);
        delay(1000);
        tft.fillScreen(0x0000);
        }
    
    
    while ( knop1 == LOW){ 
      ready = false;
    }
    if (knop1 == LOW and ready == true){
      schet  = schet + 1;
    }
}
void loop(){
    if (schet > 1) {
        tft.print("ты нажал один раз");
        delay(10000);
        
    }
}