int ledpin = 4;
int pushpin = 2;
int val;
void setup() {
pinMode(ledpin, OUTPUT);
pinMode(pushpin, INPUT);
}
void loop() {
val =digitalRead(pushpin);
if(val == HIGH);
{
digitalWrite(ledpin, HIGH);
}
else {
digitalWrite(ledpin, LOW);
}
}