41 lines
732 B
C++
41 lines
732 B
C++
// WIP. 3/28/2022: added test state machine. Need to re-write moving to next state
|
|
|
|
#include "config.h"
|
|
#include "cubeplex.h"
|
|
#include <timer.h>
|
|
|
|
Timer animationDelay;
|
|
bool animationDelayTiming = false;
|
|
|
|
int color = red;
|
|
|
|
|
|
void setup() {
|
|
Serial.begin(115200);
|
|
Serial.println("start program...");
|
|
initCube();
|
|
timerInit();
|
|
|
|
currentState = CHASETHEDOT;
|
|
lastState = -1;
|
|
|
|
// how many secconds until the animation is told to progress
|
|
animationMax = 10;
|
|
}
|
|
|
|
void loop() {
|
|
|
|
switch (currentState) {
|
|
|
|
case CHASETHEDOT:
|
|
chaseTheDot();
|
|
//currentState = PLANARFLOP3D;
|
|
break;
|
|
|
|
case PLANARFLOP3D:
|
|
planarFlop3D();
|
|
//currentState = CHASETHEDOT;
|
|
break;
|
|
}
|
|
animationDelay.update();
|
|
}
|