void setup() {
// put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(13, INPUT_PULLUP);
Serial.begin(115200);
}
void loop() {
// put your main code here, to run repeatedly:
int status = digitalRead(13);
if(status == HIGH)
{
digitalWrite(2, HIGH);
Serial.println("Switch ON, ");
Serial.println(status);
} else {
digitalWrite(2, LOW);
Serial.println("Switch OFF, ");
Serial.println(status);
} // this speeds up the simulation
}