//include the library in the program
#include <singleLEDLibrary.h>
#include <PinButton.h>
//declare your led objects that you will be using, light1 is connected to pin 9 and light 2 to pin 10
sllib led(11);
PinButton myButton(13);
int mode = 0;
void setup() {
//we make sure that our led's are doing something on startup
led.setOnSingle();
}
void loop() {
myButton.update();
//we call the update function for both led's here. Don't forget these!
led.update();
//if the button is pushed down we set light2 to be off.
//when the button is not pressed it breathes.
if (myButton.isClick()) {
mode += mode;
if (mode == 3) {
mode = 0;
}
if (mode = 0) {
led.setOnSingle();
}
else if (mode = 1) {
led.setBreathSingle(500);
}
else if (mode = 2) {
led.setBlinkSingle(500);
}
else {
led.setFlickerSingle();
}
}
}