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