You are on page 1of 2

code:

by DojoDave <http://www.0j0.org> modified 30 Aug 2011 by Tom Igoe


*/
/*
**************************************************************
Variable and Library declarations
**************************************************************
*/
// Constants:
const int ledPin = 13;// Built-in LED onboard is connected to pin 13
const int buttonPin = 17;// Built-in Button onboard is connected to pin 17

// Variables:
int buttonState = 0;

/*
**************************************************************
Pin and other Set-up Configuration
**************************************************************
*/
void setup()
{
// Initialize OUTPUTS

// Read the current state of the buttonPin


buttonState =digitalRead(buttonPin);
// Check if button is pushed
if (buttonState ==HIGH)
{
// Turn LED ON
digitalWrite(ledPin,HIGH);
}
else
{
// Turn LED OFF
digitalWrite(ledPin,LOW);
}
}

/*
**************************************************************
User Defined Functions
**************************************************************
*/

You might also like