#define LED_PIN 13 //led pin
#define SW_PIN 33 //switch pin
void setup() {
Serial.begin(115200); //starting serial communication
Serial.println("Hello, ESP32!"); //outputting message
pinMode(LED_PIN, OUTPUT);
pinMode(SW_PIN, INPUT);
}
void loop() {
int SwitchState = digitalRead((SW_PIN));
Serial.print ("Switch State is:");
Serial.println (SwitchState); //displaying the switch state
digitalWrite(LED_PIN, SwitchState);
delay (1000);
}