int led = 13;
int btn = 12;
void setup() {
// put your setup code here, to run once:
pinMode(led, OUTPUT);
pinMode(btn, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
bool btnValue = digitalRead(btn);
if(btnValue == 1){
digitalWrite(led, HIGH);
}
if(btnValue == 0){
digitalWrite(led,LOW);
}
Serial.println(btnValue);
}