#define LEDPIN 23
#define SWPIN 33
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(LEDPIN, OUTPUT);
pinMode(SWPIN, INPUT_PULLUP);
}
int sw = 0;
void loop() {
// put your main code here, to run repeatedly:
sw =digitalRead(SWPIN);
if (sw == LOW){
digitalWrite(LEDPIN, HIGH);
} else {
digitalWrite(LEDPIN, LOW);
}
Serial.println(sw);
delay(100); // this speeds up the simulation
}