const int LEDPIN = 13;
const int BUTTONPIN = 7;
void setup() {
// put your setup code here, to run once:
pinMode(LEDPIN, OUTPUT);
pinMode(BUTTONPIN, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
int digitalval = digitalRead(BUTTONPIN);
if(HIGH == digitalval)
{
digitalWrite(LEDPIN, LOW);//turn off
}
else
{
digitalWrite(LEDPIN, HIGH);//turn on
}
}