/* LightSwitch2 Turn an LED on and off. Requires pulldown resistor on input. */ int pushButtonPin = 2; // connect the push button to digital pin 2 int ledPin = 13; // connect the LED to pin 13 int buttonState; // stores current button state void setup() { pinMode(pushButtonPin, INPUT); // make the pushbutton's pin an input pinMode(ledPin, OUTPUT); // make LED's pin an output } void loop() { buttonState = digitalRead(pushButtonPin); // read the input pin digitalWrite(ledPin, buttonState); // turn the LED on or off //delay(1); // delay between reads for stability (?? I don't remember why this got in here.) }