#include #include #include /* There are two buttons on the device */ /* left button - below and to the left of RESET */ /* right button - below and to the right of RESET */ /* When you press the left button the LED will turn on */ #define LED_PIN 13 /* LED connected to digital pin 13 */ #define LEFT_BUTTON_PIN 4 /* Left button connected to pin 4 */ #define RIGHT_BUTTON_PIN 19 /* Right button connect to pin 19 */ int push_button = LEFT_BUTTON_PIN; /* Try push_button = RIGHT_BUTTON_PIN */ void setup() { pinMode(LED_PIN, OUTPUT); /* Sets the digital pin 13 as output */ pinMode(push_button, INPUT); /* Using left button; try right button */ } void loop() { int value_read = digitalRead(push_button); /* Read whether button is pressed */ digitalWrite(LED_PIN, value_read); /* Sets the LED to the button's value */ }