This commit is contained in:
Felix Pankratz 2024-12-28 16:13:44 +01:00
parent 1e97ba3a95
commit e8c734af83
2 changed files with 7 additions and 20 deletions

View File

@ -11,8 +11,8 @@ enum DisplayStyle {
Congress, Congress,
Supercomputer, Supercomputer,
Cyber, Cyber,
Plasma, Flame
Flame,
NumStyles
}; };
DisplayStyle next_style(DisplayStyle style);
#endif #endif

View File

@ -17,7 +17,7 @@
MatrixPanel_I2S_DMA *matrix = nullptr; MatrixPanel_I2S_DMA *matrix = nullptr;
Mode mode = HighVis; Mode mode = HighVis;
DisplayStyle style = Flame; DisplayStyle style = Rain;
unsigned long last_switch; unsigned long last_switch;
@ -43,7 +43,7 @@ void setup(){
matrix = new MatrixPanel_I2S_DMA(mxconfig); matrix = new MatrixPanel_I2S_DMA(mxconfig);
matrix->begin(); matrix->begin();
matrix->setBrightness8(64); matrix->setBrightness8(255);
matrix->fillScreenRGB888(0, 0, 0); matrix->fillScreenRGB888(0, 0, 0);
matrix->setTextWrap(false); matrix->setTextWrap(false);
matrix->setFont(&Pilowlava_Regular8pt7b); matrix->setFont(&Pilowlava_Regular8pt7b);
@ -56,7 +56,7 @@ void loop() {
if (millis() - last_switch > CYCLE_TIME_MS) { if (millis() - last_switch > CYCLE_TIME_MS) {
// next 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,20 +76,7 @@ void loop() {
} }
if(!digitalRead(NEXT_BUTTON)) { if(!digitalRead(NEXT_BUTTON)) {
switch(style) { style = next_style(style);
case Rain:
style = Congress;
break;
case Congress:
style = Supercomputer;
break;
case Supercomputer:
style = Cyber;
break;
case Cyber:
style = Rain;
break;
}
while(!digitalRead(NEXT_BUTTON)); // Wait for release while(!digitalRead(NEXT_BUTTON)); // Wait for release
} }