int btn = 8;
int led = 9;
boolean btnout;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(btn, INPUT);
pinMode(led, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
btnout = digitalRead(btn);
if(btnout == 1){
digitalWrite(led, HIGH);
}else{
digitalWrite(led,LOW);
}
}