Compare commits

..

No commits in common. "master" and "flame" have entirely different histories.

2 changed files with 3 additions and 31 deletions

View File

@ -1,21 +0,0 @@
#include "enums.h"
#include "constants.h"
DisplayStyle next_style(DisplayStyle style) {
switch(style) {
case Rain:
return Congress;
break;
case Congress:
return Supercomputer;
break;
case Supercomputer:
return Cyber;
break;
case Cyber:
return Flame;
break;
case Flame:
return Rain;
break;
}
}

View File

@ -20,7 +20,6 @@ Mode mode = HighVis;
DisplayStyle style = Rain;
unsigned long last_switch;
bool cycling = true;
void setup(){
pinMode(ONBOARD_LED, OUTPUT);
@ -53,8 +52,9 @@ void setup(){
void loop() {
matrix ->flipDMABuffer();
matrix->clearScreen();
//delay(25);
if (cycling and millis() - last_switch > CYCLE_TIME_MS) {
if (millis() - last_switch > CYCLE_TIME_MS) {
// next style
style = next_style(style); //DisplayStyle((style + 1) % (NumStyles - 1));
last_switch = millis();
@ -76,15 +76,8 @@ void loop() {
}
if(!digitalRead(NEXT_BUTTON)) {
unsigned long pressed_at = millis();
style = next_style(style);
while(!digitalRead(NEXT_BUTTON)); // Wait for release
// see if the button was held or tapped
if (millis() - pressed_at > 500) {
// todo
cycling = not cycling;
} else {
style = next_style(style);
}
}
switch(style) {