added asynchronous timer
This commit is contained in:
parent
53879d6546
commit
62666ebb8c
6 changed files with 608 additions and 505 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue