🔥 congress style

This commit is contained in:
Felix Pankratz 2024-12-07 23:09:51 +01:00
parent d861c43a0e
commit 4290e2dea9

View File

@ -5,6 +5,7 @@
#include "main.h"
#include "caveatbrush9pt7b.h"
#include "pillowlava8pt7b.h"
#include "overlay.h"
#define R1 42
@ -34,6 +35,7 @@
#define ONBOARD_LED 13
#define BACK_BUTTON 6
#define NEXT_BUTTON 7
MatrixPanel_I2S_DMA *matrix = nullptr;
@ -59,11 +61,19 @@ enum Mode {
HighVis
};
enum DisplayStyle {
Rain,
Congress
};
Mode mode = Stealth;
DisplayStyle style = Congress;
void setup(){
Serial.begin(BAUD_RATE);
pinMode(ONBOARD_LED, OUTPUT);
pinMode(BACK_BUTTON, INPUT_PULLUP);
pinMode(NEXT_BUTTON, INPUT_PULLUP);
for (int i = 0; i<PANEL_WIDTH; i++) {
raindrops[i].y = 0 - random(24);
@ -89,29 +99,11 @@ void setup(){
matrix->begin();
matrix->setBrightness8(64);
matrix->fillScreenRGB888(0, 0, 0);
matrix->setFont(&CaveatBrush_Regular9pt7b);
}
void loop() {
matrix ->flipDMABuffer();
matrix->clearScreen();
delay(25);
if(!digitalRead(BACK_BUTTON)) {
switch(mode) {
case Stealth:
mode = LowVis;
break;
case LowVis:
mode = HighVis;
break;
case HighVis:
mode = Stealth;
break;
}
while(!digitalRead(BACK_BUTTON)); // Wait for release
//matrix->setFont(&CaveatBrush_Regular9pt7b);
matrix->setFont(&Pilowlava_Regular8pt7b);
}
void draw_rain() {
//matrix ->drawBitmap(0, 0, overlay, 64, 32, matrix->color565(64, 0, 0));
unsigned long timestamp = millis();
for (int x = 0; x < PANEL_WIDTH; x++) {
@ -171,3 +163,84 @@ void loop() {
}
}
int running_text_pos = 7;
void draw_congress() {
matrix->fillScreenRGB888(15, 0, 10);
uint16_t grid_color = matrix->color565(25, 11, 47);
matrix->drawFastHLine(0, 0, PANEL_WIDTH, grid_color);
matrix->drawFastHLine(0, 7, PANEL_WIDTH, grid_color);
matrix->drawFastHLine(0, 24, PANEL_WIDTH, grid_color);
matrix->drawFastHLine(0, 31, PANEL_WIDTH, grid_color);
matrix->drawFastVLine(0, 0, PANEL_HEIGHT, grid_color);
matrix->drawFastVLine(63, 0, PANEL_HEIGHT, grid_color);
int v_lines = PANEL_WIDTH / 7;
for(int v; v < v_lines; v++) {
matrix->drawFastVLine(v * 7, 0, 7, grid_color);
matrix->drawFastVLine(v * 7, 24, 7, grid_color);
}
matrix->setTextWrap(false);
matrix->setTextColor(matrix->color565(255, 80, 83));
if (mode == Stealth) {
matrix->setCursor(7, 21);
matrix->print("38C3");
} else if (mode == LowVis) {
matrix->setCursor(2, 21);
matrix->print("Panki");
} else if (mode == HighVis) {
matrix->setCursor(running_text_pos, 21);
String message = "38C3 - Panki - DECT 3389 - ALL YOUR BASE ARE BELONG TO US";
matrix->print(message);
running_text_pos -= 1;
if (running_text_pos < -936) { // (0 - (13 * message.length()))) {
running_text_pos = 63;
};
delay(75);
}
}
void loop() {
matrix ->flipDMABuffer();
matrix->clearScreen();
delay(25);
if(!digitalRead(BACK_BUTTON)) {
switch(mode) {
case Stealth:
mode = LowVis;
break;
case LowVis:
mode = HighVis;
break;
case HighVis:
mode = Stealth;
break;
}
while(!digitalRead(BACK_BUTTON)); // Wait for release
}
if(!digitalRead(NEXT_BUTTON)) {
switch(style) {
case Rain:
style = Congress;
break;
case Congress:
style = Rain;
break;
}
while(!digitalRead(NEXT_BUTTON)); // Wait for release
}
switch(style) {
case Rain:
draw_rain();
break;
case Congress:
draw_congress();
break;
}
}