added asynchronous timer

This commit is contained in:
Sean 2022-04-06 21:35:35 -04:00
parent 53879d6546
commit 62666ebb8c
6 changed files with 608 additions and 505 deletions

View file

@ -1,21 +1,17 @@
// WIP. 3/28/2022: added test state machine. Need to re-write moving to next state
// WIP. 4/4/2022: started to implement delay timer asyncronously using existing timer2 interrupt.
#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();
//timerInit();
currentState = CHASETHEDOT;
lastState = -1;
@ -29,13 +25,14 @@ void loop() {
case CHASETHEDOT:
chaseTheDot();
//currentState = PLANARFLOP3D;
break;
case RANDOMRAINBOW:
rainbow_random();
break;
case PLANARFLOP3D:
planarFlop3D();
//currentState = CHASETHEDOT;
break;
}
animationDelay.update();
}