Skip to content

Commit 19a1feb

Browse files
update with adjustments from Sandros code 3.1
1 parent 5799f3e commit 19a1feb

5 files changed

Lines changed: 79 additions & 53 deletions

File tree

data/index.html

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,14 @@
289289
}
290290

291291
</style>
292-
<title>WORTUHR NESSI 3.0</title>
292+
<title>WORTUHR</title>
293293
<link rel="icon" type="image/svg" href="./icons/clock.svg">
294294
</head>
295295

296296
<body oncontextmenu="return false"> <!-- prevent opening of contextmenu -->
297297
<div class="setting-button" onclick="toggleSettings()"><img src = "./icons/settings.svg" style="height:20px; filter: invert(100%);"/></div>
298298

299-
<h1 id="headline">WORTUHR NESSI 3.0</h1>
299+
<h1 id="headline">WORTUHR NESSI 3.1</h1>
300300

301301
<div id="settings-container" class="settings-container">
302302
<div class="number-container">
@@ -332,23 +332,34 @@ <h1 id="headline">WORTUHR NESSI 3.0</h1>
332332
</div>
333333
</div>
334334
<div class="checkbox-container">
335-
<label for="StaticBackgroundPattern" style="align-self: flex-start">"HOPP HCD" (jede 5. Min.): Aus/Ein </label>
335+
<label for="StaticBackgroundPattern" style="align-self: flex-start">"WORTUHR" Aus/Ein </label>
336336
<div>
337337
<input name= "StaticBackgroundPattern" id="StaticBackgroundPattern" type="checkbox" class="toggle">
338338
</div>
339339
</div>
340340
<div class="checkbox-container">
341-
<label for="StaticBackgroundPattern2" style="align-self: flex-start">"EVZ" (jede 5. Min.): Aus/Ein </label>
341+
<label for="StaticBackgroundPattern2" style="align-self: flex-start">"NESSI" Aus/Ein </label>
342342
<div>
343343
<input name= "StaticBackgroundPattern2" id="StaticBackgroundPattern2" type="checkbox" class="toggle">
344344
</div>
345345
</div>
346-
<div class="checkbox-containerNessi">
347-
<label for="ResetWifi" style="align-self: flex-start">WLAN Anmeldedaten zurücksetzen! </label>
348-
<div>
349-
<input name= "ResetWifi" id="ResetWifi" type="checkbox" class="toggle">
350-
</div>
351-
</div>
346+
<div class="checkbox-containerNessi">
347+
<label for="ResetWifi" style="align-self: flex-start">WLAN Anmeldedaten zurücksetzen! </label>
348+
<div>
349+
<input name="ResetWifi" id="ResetWifi" type="checkbox" class="toggle" onchange="confirmReset(this)">
350+
</div>
351+
</div>
352+
353+
<script>
354+
function confirmReset(checkbox) {
355+
if (checkbox.checked) {
356+
const confirmed = confirm("Sind Sie sicher, dass Sie die WLAN-Anmeldedaten zurücksetzen möchten?");
357+
if (!confirmed) {
358+
checkbox.checked = false; // Rückgängig machen, wenn abgebrochen
359+
}
360+
}
361+
}
362+
</script>
352363
<div class="buttonClass save-button" onclick="saveSettings()">SAVE</div>
353364
</div>
354365

framefunctions.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define MILLIS_PER_MINUTE 60000
2-
#define NUM_LED_PER_SECOND 2
2+
#define NUM_LED_PER_SECOND 1 // Nessi 2 LED pro Sekunde
33

44
#include "ledring.h"
55

ledring.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#include <Adafruit_NeoPixel.h> // NeoPixel library used to run the NeoPixel LEDs:
55
#include "udplogger.h"
66

7-
#define RING_LED_COUNT 60 // number of LEDs in the ring
8-
#define RING_CURRENT_LIMIT 1000 // limit the total current sonsumed by LEDs (mA)
7+
#define RING_LED_COUNT 56 // number of LEDs in the ring
8+
#define RING_CURRENT_LIMIT 2500 // limit the total current sonsumed by LEDs (mA)
99

1010
class LEDRing {
1111
public:

wordclock_esp8266.ino

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,22 @@
22
* Wordclock 2.0 - Wordclock with ESP8266 and NTP time update
33
*
44
* created by techniccontroller 04.12.2021
5-
*
6-
* components:
5+
*
6+
* Sandro Nessenzia Anpassungen:
7+
* 04.12.2024 Version 1.0 Nachgebaut mit Deutsches Layout
8+
* 14.03.2025 Version 1.1 Erste Versuche mit Schweizerdeutsch
9+
* 20.03.2025 Version 1.2 Diverse korrekturen mit ünterstützung von Edgar
10+
* 24.04.2025 Version 2.0 WORTUHR NESSI und ES ESCH ein.- und ausschaltbar gemacht
11+
* 06.05.2025 Version 3.0 Einbau Hintergrundbeleuchtung inkl. HTML mit ünterstützung von Edgar
12+
* 02.06.2025 Version 3.1 Kleinere anpassungen
13+
* 03.12.2025 Version 3.1 Anpassung "HAPPY DAY" und "TO YOU"
14+
*
15+
* Components:
716
* - ESP8266
817
* - Neopixelstrip
918
*
1019
* Board settings:
11-
* - Board: NodeMCU 1.0 (ESP-12E Module)
20+
* - Board: ESP8266 NodeMCU 1.0 (ESP-12E Module)
1221
* - Flash Size: 4MB (FS:2MB OTA:~1019KB)
1322
* - Upload Speed: 115200
1423
*
@@ -230,7 +239,7 @@ uint8_t dynColorShiftPhase = 0; // stores the phase of the
230239
uint8_t dynColorShiftSpeed = DEFAULT_COLSHIFT_SPEED; // stores the speed of the dynamic color shift -> used to calc update period
231240
bool puristModeActive = false; // stores if purist mode is active
232241
bool staticBackgroundActive = false; // stores if static background is active
233-
bool staticBackground2Active = false; // stores if static background is active
242+
bool staticBackground2Active = false; // stores if static background2 is active
234243
bool frameLightActive = false; // stores if frame light is active
235244
bool frameSecondsActive = false; // stores if frame light should be active for seconds
236245
bool frameSecondsSingle = false; // stores if frame light should be active for seconds in single mode (false == increment mode)
@@ -312,11 +321,11 @@ void setup() {
312321

313322
// set a custom hostname
314323
wifiManager.setHostname(hostname);
315-
316-
// set timeout of config portal to 10min, continue even if not connected,
317-
// clock will show wrong time, but eventually restart after watchdog counter is 0 (after ~5min)
318-
wifiManager.setConfigPortalTimeout(600);
319324

325+
// Timeout des Konfigurationsportals auf 10 Minuten einstellen, auch ohne Verbindung fortfahren,
326+
// Die Uhr zeigt die falsche Zeit an, startet aber ggf. neu, nachdem der Watchdog-Zähler 0 ist (nach ca. 5 Minuten).
327+
wifiManager.setConfigPortalTimeout(600); // NESSI event problem Guido behoben
328+
320329
// fetches ssid and pass from eeprom and tries to connect
321330
// if it does not connect it starts an access point with the specified name
322331
// here "wordclockAP"
@@ -449,7 +458,7 @@ void setup() {
449458
ledmatrix.printNumber(4, 6, (address/10)%10, maincolor_clock);
450459
ledmatrix.printNumber(8, 6, address%10, maincolor_clock);
451460
ledmatrix.drawOnMatrixInstant();
452-
delay(2000);
461+
delay(3000); // Nessi IP verzögerung
453462

454463
// clear matrix
455464
ledmatrix.gridFlush();
@@ -1332,13 +1341,20 @@ void showStaticBackgroundPattern(){
13321341
// define the coordinates of the background pattern to light up
13331342
// top left corner is (0,0)
13341343
uint8_t coordinatesX[] = {4, 5, 6, 7, 8, 9, 10}; // Nessi (WORTUHR)
1335-
uint8_t coordinatesY[] = {3, 3, 3, 3, 3, 3, 3}; // Nessi (NESSI)
1344+
uint8_t coordinatesY[] = {3, 3, 3, 3, 3, 3, 3};
13361345

13371346
uint8_t red = 0; // red color value (0-255)
13381347
uint8_t green = 255; // green color value (0-255)
13391348
uint8_t blue = 0; // blue color value (0-255)
1340-
uint8_t patternBrightness = 255; // brightness of the pattern (0-255) -> will be scaled by global brightness, example: brightness = 128 and patternBrightness = 180 -> resulting brightness = 90 (256 * 128/256 * 180/256)
13411349

1350+
// Nessi anpassung Heligkeit
1351+
// in % (ALT)
1352+
// uint8_t patternBrightness = 0.9 * brightness; // brightness of the pattern (0-255) // Nessi 0.7 entspricht 70%
1353+
1354+
// wie Uhr (NEU)
1355+
uint8_t patternBrightness = 180; // Helligkeit des Musters (0-255) -> wird mit der globalen Helligkeit skaliert, Beispiel: Helligkeit = 128 und Musterhelligkeit = 180 -> resultierende Helligkeit = 90 (256 * 128/256 * 180/256)
1356+
// Nessi anpassung Heligkeit
1357+
13421358
if(patternBrightness < 10) patternBrightness = 10;
13431359
if(patternBrightness > 255) patternBrightness = 255;
13441360
float factor = patternBrightness / 255.0;
@@ -1350,7 +1366,7 @@ void showStaticBackgroundPattern(){
13501366
}
13511367

13521368
/**
1353-
* @brief Show a second static background pattern on the matrix
1369+
* @brief Show a second static background2 pattern on the matrix
13541370
*
13551371
* You can define which leds should be lit up by changing the coordinatesX and coordinatesY arrays.
13561372
* You can define the color by changing the color variable.
@@ -1359,17 +1375,24 @@ void showStaticBackgroundPattern(){
13591375
void showStaticBackgroundPattern2(){
13601376
// define the coordinates of the background pattern to light up
13611377
// top left corner is (0,0)
1362-
uint8_t coordinatesX[] = { 6, 7, 8, 9, 10}; // Nessi (WORTUHR)
1363-
uint8_t coordinatesY[] = { 4, 4, 4, 4, 4}; // Nessi (NESSI)
1378+
uint8_t coordinatesX[] = {6, 7, 8, 9, 10}; // Nessi (NESSI)
1379+
uint8_t coordinatesY[] = {4, 4, 4, 4, 4};
13641380

13651381
uint8_t red = 0; // red color value (0-255)
1366-
uint8_t green = 0; // green color value (0-255)
1367-
uint8_t blue = 255; // blue color value (0-255)
1368-
uint8_t patternBrightness = 255; // brightness of the pattern (0-255) -> will be scaled by global brightness, example: brightness = 128 and patternBrightness = 180 -> resulting brightness = 90 (256 * 128/256 * 180/256)
1382+
uint8_t green = 255; // green color value (0-255)
1383+
uint8_t blue = 0; // blue color value (0-255)
1384+
1385+
// Nessi anpassung Heligkeit
1386+
// in % (ALT)
1387+
// uint8_t patternBrightness = 0.9 * brightness; // brightness of the pattern (0-255) // Nessi 0.7 entspricht 70%
1388+
1389+
// wie Uhr (NEU)
1390+
uint8_t patternBrightness = 180; // Helligkeit des Musters (0-255) -> wird mit der globalen Helligkeit skaliert, Beispiel: Helligkeit = 128 und Musterhelligkeit = 180 -> resultierende Helligkeit = 90 (256 * 128/256 * 180/256)
1391+
// Nessi anpassung Heligkeit
13691392

13701393
if(patternBrightness < 10) patternBrightness = 10;
13711394
if(patternBrightness > 255) patternBrightness = 255;
1372-
float factor = patternBrightness / 255.0;
1395+
float factor = patternBrightness / 255.0;
13731396
uint32_t color = LEDMatrix::Color24bit(red * factor, green * factor, blue * factor);
13741397
ledmatrix.setDynamicColorShiftPhase(-1);
13751398
for (uint8_t i = 0; i < sizeof(coordinatesX); i++) {

wordclockfunctions.ino

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Angepasst am 01.04.2025 Sandro Nessenzia (NESSI)
44

5-
const String clockStringSwiss = "ESPESCHAFUFVIERTUBFZAAZWANZGSIVORABOHOPPOHCDHAUBIAEVZILEISZWOISDRUVIERIYFUFIOSACHSISEBNIACHTINUNIELZANIEREUFIBZWOUFINAGSI";
5+
const String clockStringSwiss = "ESPESCHAFUFVIERTUBFZAAZWANZGSIVORABOHWORTUHRHAUBIANESSIEISZWOISDRUVIERIYFUFIOSACHSISEBNIACHTINUNIELZANIEREUFIBZWOUFINAGSI";
66

77
/**
88
* @brief control the four minute indicator LEDs
@@ -16,41 +16,33 @@ void drawMinuteIndicator(uint8_t minutes, uint32_t color){
1616
switch (minutes%5)
1717
{
1818
case 0:
19-
if(staticBackgroundActive){ // Nessi show static background pattern every 5 minutes for 1 minute
20-
showStaticBackgroundPattern(); // Nessi
21-
} // Nessi
22-
if(staticBackground2Active){ // Nessi show static background pattern every 5 minutes for 1 minute
23-
showStaticBackgroundPattern2(); // Nessi
24-
} // Nessi
19+
if(staticBackgroundActive){ // Nessi Anzeige "WORTUHR" Ein.- Aus
20+
showStaticBackgroundPattern(); // Nessi
21+
}
22+
if(staticBackground2Active){ // Nessi Anzeige "NESSI" Ein.- Aus
23+
showStaticBackgroundPattern2(); // Nessi
24+
}
2525
break;
2626

2727
case 1:
2828
ledmatrix.setMinIndicator(0b1000, color);
29-
// if(staticBackgroundActive){ // Nessi show static background pattern every 1 minutes for 1 minute
30-
// showStaticBackgroundPattern(); // Nessi
31-
// } // Nessi
29+
3230
break;
3331

3432
case 2:
35-
ledmatrix.setMinIndicator(0b1100, color);
36-
// if(staticBackgroundActive){ // Nessi show static background pattern every 2 minutes for 1 minute
37-
// showStaticBackgroundPattern(); // Nessi
38-
// } // Nessi
33+
ledmatrix.setMinIndicator(0b1100, color);
34+
3935
break;
4036

4137
case 3:
4238
ledmatrix.setMinIndicator(0b1110, color);
43-
// if(staticBackgroundActive){ // Nessi show static background pattern every 3 minutes for 1 minute
44-
// showStaticBackgroundPattern(); // Nessi
45-
// } // Nessi
39+
4640
break;
4741

4842
case 4:
49-
ledmatrix.setMinIndicator(0b1111, color);
50-
// if(staticBackgroundActive){ // Nessi show static background pattern every 4 minutes for 1 minute
51-
// showStaticBackgroundPattern(); // Nessi
52-
// } // Nessi
53-
break;
43+
ledmatrix.setMinIndicator(0b1111, color);
44+
45+
break;
5446
}
5547
}
5648
}

0 commit comments

Comments
 (0)