Compare commits
No commits in common. "master" and "flame" have entirely different histories.
@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -20,7 +20,6 @@ Mode mode = HighVis;
|
|||||||
DisplayStyle style = Rain;
|
DisplayStyle style = Rain;
|
||||||
|
|
||||||
unsigned long last_switch;
|
unsigned long last_switch;
|
||||||
bool cycling = true;
|
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
pinMode(ONBOARD_LED, OUTPUT);
|
pinMode(ONBOARD_LED, OUTPUT);
|
||||||
@ -53,8 +52,9 @@ void setup(){
|
|||||||
void loop() {
|
void loop() {
|
||||||
matrix ->flipDMABuffer();
|
matrix ->flipDMABuffer();
|
||||||
matrix->clearScreen();
|
matrix->clearScreen();
|
||||||
|
//delay(25);
|
||||||
|
|
||||||
if (cycling and millis() - last_switch > CYCLE_TIME_MS) {
|
if (millis() - last_switch > CYCLE_TIME_MS) {
|
||||||
// next style
|
// next style
|
||||||
style = next_style(style); //DisplayStyle((style + 1) % (NumStyles - 1));
|
style = next_style(style); //DisplayStyle((style + 1) % (NumStyles - 1));
|
||||||
last_switch = millis();
|
last_switch = millis();
|
||||||
@ -76,15 +76,8 @@ void loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!digitalRead(NEXT_BUTTON)) {
|
if(!digitalRead(NEXT_BUTTON)) {
|
||||||
unsigned long pressed_at = millis();
|
style = next_style(style);
|
||||||
while(!digitalRead(NEXT_BUTTON)); // Wait for release
|
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) {
|
switch(style) {
|
||||||
|
Loading…
Reference in New Issue
Block a user