//adapted from Example Code(Tom Igoe) http://www.arduino.cc/en/Tutorial/Button // constants won't change. They're used here to // set pin numbers: const int buttonPin = 1; // the number of the pushbutton pin const int ledPin = 0; // the number of the LED pin not responsive to button const int ledPin2= 2; // the number of the LED pin tied to button // variables will change: int buttonState = 0; // variable for reading the pushbutton status void setup() { // initialize the LED pin as an output: pinMode(ledPin2, OUTPUT); pinMode(ledPin, OUTPUT); // initialize the pushbutton pin as an input: pinMode(buttonPin, INPUT); //sets button to input digitalWrite(ledPin, HIGH); //turns on LED 1(n } void loop() { // read the state of the pushbutton value: buttonState = digitalRead(buttonPin); if (buttonState == HIGH) { // turn LED on: digitalWrite(ledPin2, HIGH); //turn on one led } else { // turn LED off: digitalWrite(ledPin2, LOW); } }