Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e6d4a51
first commit - new way of treating 128x16
PastorL69 Mar 19, 2026
66bf1db
for testing
PastorL69 Mar 19, 2026
9aa1178
menu test
PastorL69 Mar 19, 2026
c3d74b7
incorrect declaration
PastorL69 Mar 19, 2026
dde3295
save panel.h,,.
PastorL69 Mar 19, 2026
fa4080a
check exit location
PastorL69 Mar 21, 2026
7b8ad90
fix exit location
PastorL69 Mar 21, 2026
fe7b060
fix Y_offest naming
PastorL69 Mar 21, 2026
220623b
more alignment fixes
PastorL69 Mar 21, 2026
0e63b25
don't show debug for dmdreader
PastorL69 Mar 22, 2026
32d32dd
exclude transport type, center color
PastorL69 Mar 22, 2026
a51324e
clear a specific part for x16
PastorL69 Mar 22, 2026
10b1d11
change raw file to what it will become
PastorL69 Mar 30, 2026
7eb47e7
adjusted logo
PastorL69 Mar 31, 2026
8ea63de
Merge branch 'main' of https://github.com/PPUC/ZeDMD into fix_128x16_…
PastorL69 Mar 31, 2026
33f8753
adjust menu height and merged branch fix
PastorL69 Mar 31, 2026
ea081ec
take the correct raw file
PastorL69 Mar 31, 2026
ae81be6
fixed raw file
PastorL69 Mar 31, 2026
1cf46ab
comment
PastorL69 Mar 31, 2026
cd01f17
fix color: placement
PastorL69 Mar 31, 2026
491e676
let the y offset center it
PastorL69 Mar 31, 2026
62d9ba1
also fix the static one
PastorL69 Mar 31, 2026
66c06a3
also adjust the position of the color
PastorL69 Mar 31, 2026
8e6509a
center exit
PastorL69 Mar 31, 2026
4bd19c2
no offset for exit
PastorL69 Mar 31, 2026
b6bc49a
"Test" in "LED Test" shouldn't be shown for x16
PastorL69 Mar 31, 2026
c822018
revert
PastorL69 Mar 31, 2026
5313524
format selection
PastorL69 Mar 31, 2026
19ce6df
update dmdreader as well
PastorL69 Mar 31, 2026
232f4c8
Merge branch 'main' into fix_128x16_menu
mkalkbrenner Apr 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified data/logoDEX16.raw
Binary file not shown.
Binary file modified docs/images/logos/128x16/128x16.raw
Binary file not shown.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ extra_scripts = pre:scripts/stage_fs_data.py
lib_deps =
thomasfredericks/Bounce2
https://github.com/PPUC/pimoroni-pico#13f14db59efbabdbd51f0b4ab95269e18c7701ce
https://github.com/PPUC/dmdreader#50165188eb2d0b8fd5157b64261c708a943cd70e
https://github.com/PPUC/dmdreader#5ae0e4a1489ed61f7bce0542079f554a33368683
lib_ignore =
WiFi
AsyncUDP
Expand Down
118 changes: 74 additions & 44 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ uint8_t lastBuffer __attribute__((aligned(4)));
uint8_t processingBuffer __attribute__((aligned(4)));
bool rgb565ZoneStream = false;

#ifdef ZEDMD_DEX16
int8_t yOffset = 8;
#else
int8_t yOffset = 0;
#endif
// Init display on a low brightness to avoid power issues, but bright enough to
// see something.
#ifdef DISPLAY_RM67162_AMOLED
Expand All @@ -144,6 +139,7 @@ uint8_t panelDriver = 0;
uint8_t panelI2sspeed = 8;
uint8_t panelLatchBlanking = 2;
uint8_t panelMinRefreshRate = 60;
int8_t yOffset = 0;
#ifdef DMDREADER
bool core_0_initialized = false;
bool core_1_initialized = false;
Expand Down Expand Up @@ -308,37 +304,42 @@ void DisplayVersion(bool logo = false) {
char version[10];
snprintf(version, 9, "%d.%d.%d", ZEDMD_VERSION_MAJOR, ZEDMD_VERSION_MINOR,
ZEDMD_VERSION_PATCH);
#ifdef DMDREADER
#ifdef DMDREADER
display->DisplayText(version, TOTAL_WIDTH - (strlen(version) * 4),
TOTAL_HEIGHT - 5, 255 * !logo, 255 * !logo, 255 * !logo,
logo);
#else
MENU_HEIGHT - 5 + MENU_Y_OFFSET, 255 * !logo,
255 * !logo, 255 * !logo, logo);
#else
display->DisplayText(version, TOTAL_WIDTH - (strlen(version) * 4) - 5,
TOTAL_HEIGHT - 5, 255 * !logo, 255 * !logo, 255 * !logo,
logo);
#endif
MENU_HEIGHT - 5 + MENU_Y_OFFSET, 255 * !logo,
255 * !logo, 255 * !logo, logo);
#endif
}

void DisplayLum(uint8_t r = 128, uint8_t g = 128, uint8_t b = 128) {
display->DisplayText(" ", (TOTAL_WIDTH / 2) - 26 - 1, TOTAL_HEIGHT - 6, r, g,
b);
display->DisplayText("Brightness:", (TOTAL_WIDTH / 2) - 26, TOTAL_HEIGHT - 6,
r, g, b);
DisplayNumber(brightness, 2, (TOTAL_WIDTH / 2) + 18, TOTAL_HEIGHT - 6, 255,
191, 0);
display->DisplayText(" ", (TOTAL_WIDTH / 2) - 26 - 1,
MENU_HEIGHT - 6 + MENU_Y_OFFSET, r, g, b);
display->DisplayText("Brightness:", (TOTAL_WIDTH / 2) - 26,
MENU_HEIGHT - 6 + MENU_Y_OFFSET, r, g, b);
DisplayNumber(brightness, 2, (TOTAL_WIDTH / 2) + 18,
MENU_HEIGHT - 6 + MENU_Y_OFFSET, 255, 191, 0);
}

void DisplayRGB(uint8_t r = 128, uint8_t g = 128, uint8_t b = 128) {
#ifndef DISPLAY_RM67162_AMOLED
display->DisplayText("red", 0, 0, 0, 0, 0, true, true);
display->DisplayText("red", 0, MENU_Y_OFFSET, 0, 0, 0, true, true);
for (uint8_t i = 0; i < 6; i++) {
display->DrawPixel(TOTAL_WIDTH - (4 * 4) - 1, i, 0, 0, 0);
display->DrawPixel((TOTAL_WIDTH / 2) - (6 * 4) - 1, i, 0, 0, 0);
}
display->DisplayText("blue", TOTAL_WIDTH - (4 * 4), 0, 0, 0, 0, true, true);
display->DisplayText("green", 0, TOTAL_HEIGHT - 6, 0, 0, 0, true, true);
display->DisplayText("RGB Order:", (TOTAL_WIDTH / 2) - (6 * 4), 0, r, g, b);
DisplayNumber(rgbMode, 2, (TOTAL_WIDTH / 2) + (4 * 4), 0, 255, 191, 0);
display->DrawPixel(TOTAL_WIDTH - (4 * 4) - 1, i + MENU_Y_OFFSET, 0, 0, 0);
display->DrawPixel((TOTAL_WIDTH / 2) - (6 * 4) - 1, i + MENU_Y_OFFSET, 0, 0,
0);
}
display->DisplayText("blue", TOTAL_WIDTH - (4 * 4), MENU_Y_OFFSET, 0, 0, 0,
true, true);
display->DisplayText("green", 0, MENU_HEIGHT - 6 + MENU_Y_OFFSET, 0, 0, 0,
true, true);
display->DisplayText("RGB Order:", (TOTAL_WIDTH / 2) - (6 * 4), MENU_Y_OFFSET,
r, g, b);
DisplayNumber(rgbMode, 2, (TOTAL_WIDTH / 2) + (4 * 4), MENU_Y_OFFSET, 255,
191, 0);
#endif
}

Expand Down Expand Up @@ -963,7 +964,7 @@ void DisplayLogo() {
f = LittleFS.open("/logoHD.raw", "r");
} else if (TOTAL_WIDTH == 192 && TOTAL_HEIGHT == 64) {
f = LittleFS.open("/logoSEGAHD.raw", "r");
} else if (TOTAL_WIDTH == 128 && TOTAL_HEIGHT == 16) {
} else if (TOTAL_WIDTH == 128 && MENU_HEIGHT == 18) {
f = LittleFS.open("/logoDEX16.raw", "r");
} else {
f = LittleFS.open("/logo.raw", "r");
Expand Down Expand Up @@ -1067,18 +1068,27 @@ void ScreenSaver() {
}

void RefreshSetupScreen() {
DisplayLogo();
DisplayFrame();
#ifdef ZEDMD_DEX16
for (uint16_t y = (TOTAL_HEIGHT / 32 * 5) + MENU_Y_OFFSET;
y < MENU_HEIGHT - 10; y++) {
#else
for (uint16_t y = (TOTAL_HEIGHT / 32 * 5);
y < TOTAL_HEIGHT - (TOTAL_HEIGHT / 32 * 5); y++) {
#endif
for (uint16_t x = (TOTAL_WIDTH / 128 * 5);
x < TOTAL_WIDTH - (TOTAL_WIDTH / 128 * 5); x++) {
display->DrawPixel(x, y, 0, 0, 0);
}
}
DisplayRGB();
DisplayLum();

#ifndef ZEDMD_DEX16
display->DisplayText(transport->getTypeString(), 7 * (TOTAL_WIDTH / 128),
(TOTAL_HEIGHT / 2) - 3, 128, 128, 128);
#endif
#ifndef DMDREADER
display->DisplayText("Debug:", 7 * (TOTAL_WIDTH / 128),
(TOTAL_HEIGHT / 2) - 10, 128, 128, 128);
Expand All @@ -1100,20 +1110,25 @@ void RefreshSetupScreen() {
#ifdef DMDREADER
else if (transport->isSpi()) {
display->DisplayText("Color:", 7 * (TOTAL_WIDTH / 128),
(TOTAL_HEIGHT / 2) + 4, 128, 128, 128);
(TOTAL_HEIGHT / 2) + 4 - MENU_Y_OFFSET, 128, 128, 128);
display->DisplayText(ColorString(loopbackColor),
7 * (TOTAL_WIDTH / 128) + (6 * 4),
(TOTAL_HEIGHT / 2) + 4, 255, 191, 0);
(TOTAL_HEIGHT / 2) + 4 - MENU_Y_OFFSET, 255, 191, 0);
}
#endif
#ifdef ZEDMD_HD_HALF
display->DisplayText("Y-Offset", TOTAL_WIDTH - (7 * (TOTAL_WIDTH / 128)) - 31,
(TOTAL_HEIGHT / 2) - 10, 128, 128, 128);
#endif
#ifdef ZEDMD_DEX16
display->DisplayText("LED", TOTAL_WIDTH - (7 * (TOTAL_WIDTH / 128)) - 31,
(TOTAL_HEIGHT / 2) - 3, 128, 128, 128);
#else
display->DisplayText("LED Test", TOTAL_WIDTH - (7 * (TOTAL_WIDTH / 128)) - 31,
(TOTAL_HEIGHT / 2) - 3, 128, 128, 128);
#endif
display->DisplayText("Exit", TOTAL_WIDTH - (7 * (TOTAL_WIDTH / 128)) - 15,
(TOTAL_HEIGHT / 2) + 4, 128, 128, 128);
(MENU_HEIGHT / 2) + 4, 128, 128, 128);
}

uint8_t HandleData(uint8_t *pData, size_t len) {
Expand Down Expand Up @@ -1422,7 +1437,8 @@ uint8_t HandleData(uint8_t *pData, size_t len) {
Serial.write(CtrlChars, N_ACK_CHARS);
Serial.flush();
}
display->DisplayText("Saving settings ...", 0, 0, 255, 0, 0);
display->DisplayText("Saving settings ...", MENU_Y_OFFSET, 0, 255,
0, 0);
display->Render();
SaveLum();
SaveDebug();
Expand All @@ -1439,7 +1455,8 @@ uint8_t HandleData(uint8_t *pData, size_t len) {
#ifdef ZEDMD_HD_HALF
SaveYOffset();
#endif
display->DisplayText("Saving settings ... done", 0, 0, 255, 0, 0);
display->DisplayText("Saving settings ... done", MENU_Y_OFFSET, 0,
255, 0, 0);
display->Render();
headerBytesReceived = 0;
numCtrlCharsFound = 0;
Expand Down Expand Up @@ -2022,7 +2039,7 @@ void setup() {

RefreshSetupScreen();
display->DisplayText("Exit", TOTAL_WIDTH - (7 * (TOTAL_WIDTH / 128)) - 15,
(TOTAL_HEIGHT / 2) + 4, 255, 191, 0);
(MENU_HEIGHT / 2) + 4, 255, 191, 0);

const auto forwardButton = new Bounce2::Button();
forwardButton->attach(FORWARD_BUTTON_PIN, INPUT_PULLUP);
Expand Down Expand Up @@ -2081,7 +2098,7 @@ void setup() {
RefreshSetupScreen();
display->DisplayText("Exit",
TOTAL_WIDTH - (7 * (TOTAL_WIDTH / 128)) - 15,
(TOTAL_HEIGHT / 2) + 4, 255, 191, 0);
(MENU_HEIGHT / 2) + 4, 255, 191, 0);
break;
}
case 2: { // Brightness
Expand All @@ -2099,7 +2116,8 @@ void setup() {
case 4: { // Color
RefreshSetupScreen();
display->DisplayText("Color:", 7 * (TOTAL_WIDTH / 128),
TOTAL_HEIGHT / 2 + 4, 255, 191, 0);
(TOTAL_HEIGHT / 2) + 4 - MENU_Y_OFFSET, 255,
191, 0);
break;
}
#else
Expand Down Expand Up @@ -2130,9 +2148,15 @@ void setup() {
}
case 8: { // LED Test
RefreshSetupScreen();
#ifdef ZEDMD_DEX16
display->DisplayText("LED",
TOTAL_WIDTH - (7 * (TOTAL_WIDTH / 128)) - 31,
(TOTAL_HEIGHT / 2) - 3, 255, 191, 0);
#else
display->DisplayText("LED Test",
TOTAL_WIDTH - (7 * (TOTAL_WIDTH / 128)) - 31,
(TOTAL_HEIGHT / 2) - 3, 255, 191, 0);
TOTAL_WIDTH - (7 * (TOTAL_WIDTH / 128)) - 31,
(TOTAL_HEIGHT / 2) - 3, 255, 191, 0);
#endif
break;
}
#ifdef ZEDMD_HD_HALF
Expand Down Expand Up @@ -2202,9 +2226,9 @@ void setup() {
// 255, set it to DMD_WHITE
loopbackColor = ((uint8_t)Color::DMD_WHITE);

display->DisplayText(ColorString(loopbackColor),
7 * (TOTAL_WIDTH / 128) + (6 * 4),
TOTAL_HEIGHT / 2 + 4, 255, 191, 0);
display->DisplayText(
ColorString(loopbackColor), 7 * (TOTAL_WIDTH / 128) + (6 * 4),
TOTAL_HEIGHT / 2 + 4 - MENU_Y_OFFSET, 255, 191, 0);
break;
}
#else
Expand Down Expand Up @@ -2276,12 +2300,18 @@ void setup() {
--ledTest >
3) // underflow will result in 255, set it to 2
ledTest = 3;
switch(ledTest) {
switch (ledTest) {
case 0:
RefreshSetupScreen();
display->DisplayText("LED Test",
TOTAL_WIDTH - (7 * (TOTAL_WIDTH / 128)) - 31,
(TOTAL_HEIGHT / 2) - 3, 255, 191, 0);
#ifdef ZEDMD_DEX16
display->DisplayText(
"LED", TOTAL_WIDTH - (7 * (TOTAL_WIDTH / 128)) - 31,
(TOTAL_HEIGHT / 2) - 3, 255, 191, 0);
#else
display->DisplayText(
"LED Test", TOTAL_WIDTH - (7 * (TOTAL_WIDTH / 128)) - 31,
(TOTAL_HEIGHT / 2) - 3, 255, 191, 0);
#endif
break;
case 1:
display->FillScreen(255, 0, 0);
Expand Down
15 changes: 9 additions & 6 deletions src/panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
#define PANEL_WIDTH 64 // Width: number of LEDs for 1 panel.
#define PANEL_HEIGHT 64 // Height: number of LEDs.
#define PANELS_NUMBER 3 // Number of horizontally chained panels.
#elif defined(ZEDMD_DEX16)
#define PANEL_WIDTH 64 // Width: number of LEDs for 1 panel.
#define PANEL_HEIGHT 32 // Height: number of LEDs.
#define PANELS_NUMBER 2 // Number of horizontally chained panels.
#endif
#ifndef PANEL_WIDTH
#define PANEL_WIDTH 64 // Width: number of LEDs for 1 panel.
Expand All @@ -27,12 +23,19 @@
#define TOTAL_WIDTH (PANEL_WIDTH * PANELS_NUMBER)
#ifdef ZEDMD_HD_HALF
#define TOTAL_HEIGHT (PANEL_HEIGHT / 2)
#elif defined(ZEDMD_DEX16)
#define TOTAL_HEIGHT (PANEL_HEIGHT / 2)
#elif defined(ZEDMD_DEX16) // should be centered and 18 pixels high
#define MENU_HEIGHT ((PANEL_HEIGHT / 2) + 2)
#define MENU_Y_OFFSET 7
#endif
#ifndef TOTAL_HEIGHT
#define TOTAL_HEIGHT PANEL_HEIGHT
#endif
#ifndef MENU_HEIGHT
#define MENU_HEIGHT PANEL_HEIGHT
#endif
#ifndef MENU_Y_OFFSET
#define MENU_Y_OFFSET 0
#endif
#define TOTAL_BYTES (TOTAL_WIDTH * TOTAL_HEIGHT * 3)
#define RGB565_TOTAL_BYTES (TOTAL_WIDTH * TOTAL_HEIGHT * 2)
#define ZONE_WIDTH (TOTAL_WIDTH / 16)
Expand Down
Loading