//Pin 3 : Input for reading the Button
//Pin 2: Output for controlling the LED
int ButtonValue = 0;
int Button = 3;
int LED = 2;
void setup() {
// put your setup code here, to run once:
pinMode(Button, INPUT);
pinMode(LED, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
ButtonValue = digitalRead(Button);
if (ButtonValue != 0){
//if button is pressed then turn the led on!
digitalWrite(LED, HIGH);
}
else{
//else the butto is not pressed, turn it off
digitalWrite(LED, HIGH);
}
}