// ACTIVITY 2: LED WITH BUTTON
const int buttonPin = 5;
const int ledPin = 11;
int buttonstate = 0;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT_PULLUP);
}
void loop() {
buttonstate = digitalRead(buttonPin);
if (buttonstate != HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
} else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}