#define BTN_PIN 15
#define LED_PIN 23
int btn_state;
void setup() {
Serial.begin(115200);
pinMode(BTN_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
}
void loop() {
btn_state = digitalRead(BTN_PIN);
/*Serial.print("Button state : ");
Serial.println(btn_state);
delay(1000);*/
if (btn_state == HIGH){
digitalWrite(LED_PIN, HIGH);
}
else {
digitalWrite(LED_PIN, LOW);
}
delay(100);
}