Skip to content

Instantly share code, notes, and snippets.

const int buttonPin = 2;// the number of the pushbutton pin
const int butpin = 3;
const int ledpin2 = 9;
const int ledPin = 8;// the number of the LED pin
const int fadingDelay = 25; // the speed of LED fading (higher value = slower)
// variables will change:
int butState = 0;
int buttonState = 0; // variable for reading the pushbutton status
boolean fadingState = false; // determines whether the LED needs to be turned on or off