int LED = 8;
int PushButton = 7;
int state = 0;
void setup() {
// put your setup code here, to run once:
pinMode(LED, OUTPUT);
pinMode(PushButton, INPUT_PULLUP);
digitalWrite(LED, LOW);
}
void loop() {
// put your main code here, to run repeatedly:
state = digitalRead(PushButton);
if (!state == HIGH)
{
digitalWrite(LED, HIGH);
}
else
{
digitalWrite(LED, LOW);
}
}