const int8_t ledPin = 23;
int8_t ledState = LOW;
unsigned long previousMillis = 0;
const unsigned long interval = 1000;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
Serial.println(ledPin);
pinMode(ledPin, OUTPUT);
// digitalWrite(ledPin, HIGH);
}
void loop() {
// put your main code here, to run repeatedly:
// delay(10); // this speeds up the simulation
unsigned long currentMillis = millis();
if(currentMillis - previousMillis >= interval){
previousMillis = currentMillis;
// if(ledState == LOW){
// ledState = HIGH;
// } else {
// ledState = LOW;
// }
ledState = !ledState;
digitalWrite(ledPin, ledState);
}
// digitalWrite(ledPin, ledState);
}