#define LED_PIN 13
#define BUTTON_PIN 7
// the setup function runs once when you press reset or power the board
void setup()
{
// initialize digital LED pin
pinMode(LED_PIN, OUTPUT);
// initialize digital input pin
pinMode(BUTTON_PIN, INPUT_PULLUP );
} // end setup
////////////////////////////////////////////////////////////////////////////////
// the loop function runs over and over again forever
void loop()
{
// test if button is pressed
if ( digitalRead( BUTTON_PIN ) == 0 )
{
digitalWrite(LED_PIN, HIGH );
} // end if
else
{
digitalWrite(LED_PIN, LOW );
} // end else
} // end loop