41 lines
675 B
C++
41 lines
675 B
C++
// WIP. 4/13/2022: added pin change interrupt to handle changing animations
|
|
|
|
#include "config.h"
|
|
#include "cubeplex.h"
|
|
|
|
int color = red;
|
|
|
|
void setup() {
|
|
Serial.begin(115200);
|
|
Serial.println("start program...");
|
|
initCube();
|
|
initButton();
|
|
|
|
currentState = CHASETHEDOT;
|
|
lastState = -1;
|
|
|
|
// how many secconds until the animation is told to progress
|
|
animationMax = 10;
|
|
}
|
|
|
|
void loop() {
|
|
|
|
switch (currentState) {
|
|
|
|
case CHASETHEDOT:
|
|
chaseTheDot();
|
|
break;
|
|
|
|
case RAINBOWRANDOM:
|
|
rainbow_random();
|
|
break;
|
|
|
|
case RAINBOWCORNER:
|
|
rainbow_corner();
|
|
break;
|
|
|
|
case PLANARFLOP3D:
|
|
planarFlop3D();
|
|
break;
|
|
}
|
|
}
|