From 33cd52cddd6f81a8cf4c5a7b7b9d00028474450f Mon Sep 17 00:00:00 2001 From: bwente Date: Tue, 25 Aug 2020 04:33:47 -0400 Subject: [PATCH] design updates (#1112) * initial word clock usermod Based on code provided by Aircoookie I added my code to create a word clock using a 8x8 RGB matrix * construction source files files for laser or 3d printing enclosures * Update word-clock-matrix.cpp fixed missed localTime var and removed brightness schedule to use timed macros Co-authored-by: Aircoookie --- .../word-clock-matrix/Word Clock Baffle.stl | Bin 0 -> 22684 bytes .../word-clock-matrix/word clock stencil.svg | 846 ++++++++++++++++++ .../word-clock-matrix/word-clock-matrix.cpp | 56 +- 3 files changed, 886 insertions(+), 16 deletions(-) create mode 100644 usermods/word-clock-matrix/Word Clock Baffle.stl create mode 100644 usermods/word-clock-matrix/word clock stencil.svg diff --git a/usermods/word-clock-matrix/Word Clock Baffle.stl b/usermods/word-clock-matrix/Word Clock Baffle.stl new file mode 100644 index 0000000000000000000000000000000000000000..ed34a68f8cf81ad4ca26bb49422a48a7d9370875 GIT binary patch literal 22684 zcmb`PKd5b6b;h?K!GKtWXeoriEg}&tQ=D@z7C}gBAt_S5Di9FtH;5Pr7Gfpn2@>@;PpTEW%w&JoS^*>8T~ z9u4=1FMQ=c?iB;c`|LNr^pC#^el z)|2hFUVCAAb7dU~%3IN`uMlVz`q}c0TZru2w5yhy7hgKVihxV&czTb(C#^|n@#k}W z)Du^fwQ_xkgX#*mDEaG8-d!$lKGEO)`1gMQ-S>X|&mTko>tFnMqxE-vY)kZYoX_kC zLf*x~pzU?gn}Fy4?6vyZ*FN{6;ZHvO_o0>LXkThgG=95XgK$Yh=yQZ>4H?bV=wZj! zML{%|P6Ol(#4a9K+pz)RY?rm)|HD7sd?FdpS$FPketO#9em9r%6}r*L*ic(D?ciJn`ryZ`~RjXL2&hX(|YFq37^X3N!74>(2{Wte# zmS>%=Abpk9-pdmb`)Zx66d#}K-aJ$q|=!VjXRa zmF4u>(DoIlPfNLOmgB4Bu@F>OBIr)7Yyh!(diCx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5!5}`&xY`%vq}m06OdL)O;_||EkH~PBX&=VV%wqr!wxaMw-yuqm^ek zlHQ0t4Zq?o`WVscD?<5$^w9nmh;=abuDF-5i6Z3FA+>3@Q^s1F~M-#;cI_oPUT=RGHS%21Q zlEJqe!q~H-BHc7xL5M3K|GzCT-Kp-F`qhb855HvT2`8sID)c!*`!eG+LLHU$ za~aLm=!xhjqS5_aE1hIV*0vXrk!;7K$qd&A8FP+M9>WznSt6w8M81)pnq+1~MiBH5 zA<)p>_01>x278ZyO9*P^HUcgo=o0DRkzrpctFgATFZBB%+_lkm+R^$dn(a4e5Yft+ zp?7`xmmQ&xwAv%A6*-0s{pko&6Y^Cu{8j|XL?N>8M5JG-i*gg{cZ;EI$7=|`#q0OG z=_UPpnD$R-+x;5Cp0-Dx5nEpuEq%GAgx-I5H|=Ny)4kB9*9dk8$eXE$r|%{63v=lb z8Of!7f92aGcj}3dbfy>4oNA$u;;~1}x2lq%k2O<8ktMq0?rC!ek++WaDD#}OGJT{K zPr_w%Pp|P+xU4%|S~vYHc68N7Mt+}kxpdS*uXY?G9CKY4;h|T{)iW%^ z`|jx=(2h3{dXjlZmNRiiFKMRx0P~=@nqFgW87l%VtwW=YWhpa!I{UuNd7ky?5z-2-=x(k4KZyA*YcGRHNyeTwe|nm=9@^{NcW)!$5}Mv6gg()V`Lidz z&}I1+Md`jrcp_(Jw1g)ao3C^Nkkvv%XT4->h;Yqc?_}K)lI_}yS_|z6QfaYTRHQd; zc~rBdU`JP{&OYo2z1q=pyG}A@(a=aB9(sazLwnM1@6OX1eWeLrh*p*{5%{FJ8jW5? z#g6%HU)JHr4n5i1(Z4nM(a`%WUJC%$ruQW~46SXgN)>lNh=I + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/usermods/word-clock-matrix/word-clock-matrix.cpp b/usermods/word-clock-matrix/word-clock-matrix.cpp index ba3c8388..aadfb8b1 100644 --- a/usermods/word-clock-matrix/word-clock-matrix.cpp +++ b/usermods/word-clock-matrix/word-clock-matrix.cpp @@ -18,6 +18,14 @@ int nightBrightness = 16; //gets called once at boot. Do all initialization that doesn't depend on network here void userSetup() { +saveMacro(14, "A=128", false); +saveMacro(15, "A=64", false); +saveMacro(16, "A=16", false); + +saveMacro(1, "&FX=0&R=255&G=255&B=255", false); + +//strip.getSegment(1).setOption(SEG_OPTION_SELECTED, true); + //select first two segments (background color + FX settable) WS2812FX::Segment &seg = strip.getSegment(0); seg.colors[0] = ((0 << 24) | ((0 & 0xFF) << 16) | ((0 & 0xFF) << 8) | ((0 & 0xFF))); @@ -38,21 +46,31 @@ void userConnected() { } +void selectWordSegments(bool state) +{ + for (int i = 1; i < 10; i++) + { + //WS2812FX::Segment &seg = strip.getSegment(i); + strip.getSegment(i).setOption(0, state); + // strip.getSegment(1).setOption(SEG_OPTION_SELECTED, true); + //seg.mode = 12; + //seg.palette = 1; + //strip.setBrightness(255); + } + strip.getSegment(0).setOption(0, !state); +} void hourChime() { - strip.resetSegments(); - - WS2812FX::Segment &seg = strip.getSegment(0); - seg.colors[0] = ((0 << 24) | ((0 & 0xFF) << 16) | ((0 & 0xFF) << 8) | ((0 & 0xFF))); - for (int i = 1; i < 10; i++) - { - WS2812FX::Segment &seg = strip.getSegment(i); - strip.getSegment(i).setOption(0, true); - seg.mode = 12; - seg.palette = 1; - strip.setBrightness(255); - } + //strip.resetSegments(); + selectWordSegments(true); + colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED); + savePreset(13, false); + selectWordSegments(false); + //strip.getSegment(0).setOption(0, true); + strip.getSegment(0).setOption(2, true); + applyPreset(12); + colorUpdated(NOTIFIER_CALL_MODE_FX_CHANGED); } void displayTime(byte hour, byte minute) @@ -237,9 +255,13 @@ void displayTime(byte hour, byte minute) strip.setSegment(7, 56, 60); break; //twelve } + +selectWordSegments(true); +applyMacro(1); } void timeOfDay() { +// NOT USED: use timed macros instead //Used to set brightness dependant of time of day - lights dimmed at night //monday to thursday and sunday @@ -265,17 +287,19 @@ void timeOfDay() { //loop. You can use "if (WLED_CONNECTED)" to check for successful connection void userLoop() { - if (minute(local) != minuteLast) + if (minute(localTime) != minuteLast) { updateLocalTime(); - timeOfDay(); + //timeOfDay(); minuteLast = minute(localTime); displayTime(hour(localTime), minute(localTime)); if (minute(localTime) == 0){ - //hourChime(); + hourChime(); } if (minute(localTime) == 1){ - //userSetup(); + //turn off background segment; + strip.getSegment(0).setOption(2, false); + //applyPreset(13); } } }