void setup() {
// put your setup code here, to run once:
pinMode(8, INPUT);
pinMode(10, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int switchState = digitalRead(8);
if(switchState == 0)
{
digitalWrite(10, HIGH);
Serial.println("Switch ON, LED ON");
}else{
digitalWrite(10, LOW);
Serial.println("Switch OFF, LED OFF");
}
}