From e8c734af836716383fedcdfea7d1e7ab33aa9e61 Mon Sep 17 00:00:00 2001 From: Felix Pankratz Date: Sat, 28 Dec 2024 16:13:44 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nametag/src/enums.h | 6 +++--- nametag/src/main.cpp | 21 ++++----------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/nametag/src/enums.h b/nametag/src/enums.h index 61a856e..bdbd2f4 100644 --- a/nametag/src/enums.h +++ b/nametag/src/enums.h @@ -11,8 +11,8 @@ enum DisplayStyle { Congress, Supercomputer, Cyber, - Plasma, - Flame, - NumStyles + Flame }; + +DisplayStyle next_style(DisplayStyle style); #endif diff --git a/nametag/src/main.cpp b/nametag/src/main.cpp index 5eae744..ff458a9 100644 --- a/nametag/src/main.cpp +++ b/nametag/src/main.cpp @@ -17,7 +17,7 @@ MatrixPanel_I2S_DMA *matrix = nullptr; Mode mode = HighVis; -DisplayStyle style = Flame; +DisplayStyle style = Rain; unsigned long last_switch; @@ -43,7 +43,7 @@ void setup(){ matrix = new MatrixPanel_I2S_DMA(mxconfig); matrix->begin(); - matrix->setBrightness8(64); + matrix->setBrightness8(255); matrix->fillScreenRGB888(0, 0, 0); matrix->setTextWrap(false); matrix->setFont(&Pilowlava_Regular8pt7b); @@ -56,7 +56,7 @@ void loop() { if (millis() - last_switch > CYCLE_TIME_MS) { // next style - style = DisplayStyle((style + 1) % (NumStyles - 1)); + style = next_style(style); //DisplayStyle((style + 1) % (NumStyles - 1)); last_switch = millis(); } @@ -76,20 +76,7 @@ void loop() { } if(!digitalRead(NEXT_BUTTON)) { - switch(style) { - case Rain: - style = Congress; - break; - case Congress: - style = Supercomputer; - break; - case Supercomputer: - style = Cyber; - break; - case Cyber: - style = Rain; - break; - } + style = next_style(style); while(!digitalRead(NEXT_BUTTON)); // Wait for release }