int buttonPin = 7; // the pushbutton is on pin D7 of the ThinkerShield int ledPin = 12; // the LED is on pin D12 int buttonState = 0; // variable for reading the pushbutton's state void setup() { pinMode(ledPin, OUTPUT); // the LED pin is an output pinMode(buttonPin, INPUT); // the button pin is an input } void loop() { buttonState = digitalRead(buttonPin); // read the button if (buttonState == HIGH) { // is it pressed? digitalWrite(ledPin, HIGH); // yes -> LED on } else { digitalWrite(ledPin, LOW); // no -> LED off } }