This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int LED = 9; // the pin for the LED | |
int i = 0; // We'll use this to count up and down | |
int led = 13; | |
const int BUTTON = 7; // input pin of the pushbutton | |
int val = 0; // stores the state of the input pin | |
int old_val = 0; // stores the previous value of "val" | |
int state = 0; // 0 = LED off while 1 = LED on | |
int brightness = 128; // Stores the brightness value | |
unsigned long startTime = 0; // when did we begin pressing |