byte buttonPin=12;
byte ledPin=32;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
pinMode(buttonPin,INPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int buttonState=digitalRead(buttonPin);
Serial.println(buttonState);
delay(1000);
if(buttonState==HIGH)
{
digitalWrite(ledPin, HIGH);
}
else
{
digitalWrite(ledPin, LOW);
}
}