// lab3 Arduino_Switch
#define BUTTON_PIN 4
#define pressed LOW
void setup()
{
// put your setup code here, to run once
Serial.begin(9600);
pinMode(BUTTON_PIN, INPUT_PULLUP);
}
void loop()
{
// put your main code here, to run repratedly:
int value = digitalRead(BUTTON_PIN);
if(value == pressed)
{
Serial.println("pressed Switch");
delay(500);
}
}