From e57869202e8bdf5dfe84eb2470e0666e328e0556 Mon Sep 17 00:00:00 2001 From: Lorenz Nimmervoll <40146720150346@litec.ac.at> Date: Sun, 13 Jan 2019 16:45:50 +0100 Subject: [PATCH] Adapted code to work with the DIY-Nanoleafs --- .vs/ProjectSettings.json | 3 + .vs/__vm/.vsarduino.h | 113 ++++ .vs/config/applicationhost.config | 1025 +++++++++++++++++++++++++++++ .vs/slnx.sqlite | Bin 0 -> 118784 bytes CppProperties.json | 47 ++ Fields.h | 11 + GradientPalettes.h | 559 ++++++++-------- TwinkleFOX.h | 177 +++-- Twinkles.h | 55 +- data/index.htm | 58 +- esp8266-fastled-webserver.ino | 553 +++++++--------- 11 files changed, 1929 insertions(+), 672 deletions(-) create mode 100644 .vs/ProjectSettings.json create mode 100644 .vs/__vm/.vsarduino.h create mode 100644 .vs/config/applicationhost.config create mode 100644 .vs/slnx.sqlite create mode 100644 CppProperties.json diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 0000000..52565e8 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": "Visual Micro" +} \ No newline at end of file diff --git a/.vs/__vm/.vsarduino.h b/.vs/__vm/.vsarduino.h new file mode 100644 index 0000000..8921b53 --- /dev/null +++ b/.vs/__vm/.vsarduino.h @@ -0,0 +1,113 @@ +/* + Editor: https://www.visualmicro.com/ + visual micro and the arduino ide ignore this code during compilation. this code is automatically maintained by visualmicro, manual changes to this file will be overwritten + the contents of the Visual Micro sketch sub folder can be deleted prior to publishing a project + all non-arduino files created by visual micro and all visual studio project or solution files can be freely deleted and are not required to compile a sketch (do not delete your own code!). + note: debugger breakpoints are stored in '.sln' or '.asln' files, knowledge of last uploaded breakpoints is stored in the upload.vmps.xml file. Both files are required to continue a previous debug session without needing to compile and upload again + + Hardware: WeMos D1 R2 & mini, Platform=esp8266, Package=esp8266 +*/ + +#if defined(_VMICRO_INTELLISENSE) + +#ifndef _VSARDUINO_H_ +#define _VSARDUINO_H_ +#define __ESP8266_ESp8266__ +#define __ESP8266_ESP8266__ +#define __ets__ +#define ICACHE_FLASH +#define F_CPU 80000000L +#define LWIP_OPEN_SRC +#define TCP_MSS 536 +#define ARDUINO 10807 +#define ARDUINO_ESP8266_WEMOS_D1MINI +#define ARDUINO_ARCH_ESP8266 +#define ESP8266 +#define __cplusplus 201103L +#undef __cplusplus +#define __cplusplus 201103L +#define __STDC__ +#define __ARM__ +#define __arm__ +#define __inline__ +#define __asm__(x) +#define __asm__ +#define __extension__ +#define __ATTR_PURE__ +#define __ATTR_CONST__ +#define __volatile__ + + +#define __ASM +#define __INLINE +#define __attribute__(noinline) + +//#define _STD_BEGIN +//#define EMIT +#define WARNING +#define _Lockit +#define __CLR_OR_THIS_CALL +#define C4005 +#define _NEW + +//typedef int uint8_t; +//#define __ARMCC_VERSION 400678 +//#define PROGMEM +//#define string_literal +// +//#define prog_void +//#define PGM_VOID_P int +// + +typedef int _read; +typedef int _seek; +typedef int _write; +typedef int _close; +typedef int __cleanup; + +//#define inline + +#define __builtin_clz +#define __builtin_clzl +#define __builtin_clzll +#define __builtin_labs +#define __builtin_va_list +typedef int __gnuc_va_list; + +#define __ATOMIC_ACQ_REL + +#define __CHAR_BIT__ +#define _EXFUN() + +typedef unsigned char byte; +extern "C" void __cxa_pure_virtual() {;} + + +typedef long __INTPTR_TYPE__ ; +typedef long __UINTPTR_TYPE__ ; +typedef long __SIZE_TYPE__ ; +typedef long __PTRDIFF_TYPE__; + + +#include "new" +#include "Esp.h" + + +#include +#include + +#include "..\generic\Common.h" +#include "..\generic\pins_arduino.h" + +#undef F +#define F(string_literal) ((const PROGMEM char *)(string_literal)) +#undef PSTR +#define PSTR(string_literal) ((const PROGMEM char *)(string_literal)) +//current vc++ does not understand this syntax so use older arduino example for intellisense +//todo:move to the new clang/gcc project types. +#define interrupts() sei() +#define noInterrupts() cli() + +#include "esp8266-fastled-webserver.ino" +#endif +#endif diff --git a/.vs/config/applicationhost.config b/.vs/config/applicationhost.config new file mode 100644 index 0000000..46c8854 --- /dev/null +++ b/.vs/config/applicationhost.config @@ -0,0 +1,1025 @@ + + + + + + + +
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..e5424844c80de7fc02dfcd59997c239c6d60813c GIT binary patch literal 118784 zcmeFa2VfgT);O-!N?L8V<=B$#6eV$-IJO+iwu&hM$8i!v;yAHQ2yrkft3-)gET_?> z9B{zV%h7vpcl0}Y?&zK4C`UVv-tP_$IN*T)n;GqDwce0$zwgTT|76I#nfKnbH*aR= zy&dgzFI$`(Q@n}c(ZR@=x5-jup(xAVUa!SsX@Gx|;Gg07&WLJBl_~eBW-c zBWC#<#N(2`5jOF!^E0@qY>GM8@ue+JKS|fnQ+HHA0bh{7e^dev$${%nPZJsU3LlkT zk{pUFTe`OnMu!LHD~aS#ax6JK)K8*AYZfF2l#Y0RhZ&R9w!FQyr`_ApIlp~>@2XuY zW3|Y6y-PdCbFcQ!T9sev>Y8+kz_{C>k!|LU?2HU5=1miK(zIO8A8Zg}TkUOIx_B|_ zXXnzk*6#M2ql$RO?ekH`c8^7(1B$WR#A&&#qB2j7P(nSCf@O+j`(VjZBP5c z_T}EL4N`_Nc&Z0qV-8Uk|Gkit;2V6f)5FK&naL+{&K=eMgB5#e<1*SfrI zQS0(qje$Uo))<4#)GP}&4h(EvwlOl0OeB@KSpoU7R`cx(g4}W@IyH*EqgB;UK;5-kKUy1~u^*QAkYQJUR7t%}08Yl~W$cT!f2pv-Yj0=AvR>`cq4H>%H04q$*>1r@LdB2<8`cYr zx}P$df{8V5@y<{Td^?y8f=ns4_IxkCta6jWHcQBbUAeZ6u9M=z(wce652g z6K;Sp15)I4iCw=VFtXq_lO2JPyIC=kbvb`@i)*%Rwc(}hm>IdHO(#%eUG{v% zGLm(wWhDKRDrWYeRcH7Pp42-Wg4`0J+jDfJP)k>P=XH$Vk1UR)#+F7?%IGEqp5eLG zBfD*Z&BcP&-o-uM*v3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%-itCqE~*FsCWIv7n$ar)SS;{*FaOt&OZQz1iMEZ$Vyu zer{GyK|w*GHy?Fav$CbrzoLXGV<}gYKhzOGLa=2~pgq`G(y}br&SFPeIy)%C(X8U> zN;P*ZYp7dMkeABV=VOnSp362n*wN(=4X+5&FyuW23DT4ZU5(+o3m;_UD$;hcD_Gsy z+POL-;}@?3yG7{wR&;d)8+^Xv)`l)#E}w5odt+CyrPb#P1?$`W?Q}!=e5G{Pl$R8v z1hi-Wv#~RV|E9FH71ID)1BhS5xu!SUz@*S2?cl2A$x8UpKlQ*FQ+LUqc&w_ z{Lk*ERb?q1NB}F|>>x$A0?p@cA0ObxZ^K8&^bUYio#3-qEGCf&& zo`v-}nK@1Mg&wM?zIh`B^!XYL!{^J%D9FhARj%i+RoMQY=?`E0KS}}V<<95hH%tH9 zg5L;{yW>|W@lU_>?dus6^qw>P!ZyY%wb_9bO8 zFV4LgFmP@38+lz_&-*5kyG?aPpL})J%&UptP>2 zs&+y_CjOO2wwKQ-tE!t(RZ>}3Q(Y9LSr=(&=Oi{Uz^b*ks+(HLWo+!Z5c^1}?FhCkjM>g) z+vF*>*DMcq(g?Y+hwGbI+S=ai?~K_$NHcwfLctn(HU}!;zHx`kvm*R1liKNTXTwR; zR5Mh(<}#Yhr8C$RB+odyY2 z8W^a7ff^X7fq@zrsDXhR7^s1P8W^a7ff^X7fq@$M#Tqbk*+5&=L449`)goLKDG;46+}j=17aDHOpj1AH7ccSuZpXII7j=^8 P+CvBLYTkTB{{Mdg%MN<6 literal 0 HcmV?d00001 diff --git a/CppProperties.json b/CppProperties.json new file mode 100644 index 0000000..d1a80d9 --- /dev/null +++ b/CppProperties.json @@ -0,0 +1,47 @@ +{ + "configurations": [ + { + "name": "Visual Micro", + "intelliSenseMode": "msvc-x64", + "includePath": [ + "${projectRoot}..\\esp8266-fastled-webserver", + "D:\\Music\\Documents\\Arduino\\libraries\\FastLED", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.1\\libraries\\ESP8266WiFi\\src", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.1\\libraries\\ESP8266WebServer\\src", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.1\\libraries\\ESP8266HTTPUpdateServer\\src", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.1\\libraries\\EEPROM", + "S:\\Software\\Arduino\\libraries", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.1\\libraries", + "D:\\Music\\Documents\\Arduino\\libraries", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.1\\cores\\esp8266", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.1\\cores\\esp8266\\libb64", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.1\\cores\\esp8266\\spiffs", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.1\\cores\\esp8266\\umm_malloc", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.1\\variants\\d1_mini", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.1\\tools\\sdk\\include", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.1\\tools\\sdk\\lwip2\\include", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.1\\tools\\sdk\\libc\\xtensa-lx106-elf\\include", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\1.20.0-26-gb404fb9-2\\xtensa-lx106-elf\\include\\c++\\4.8.2", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\1.20.0-26-gb404fb9-2\\xtensa-lx106-elf\\include\\c++\\4.8.2\\xtensa-lx106-elf", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\1.20.0-26-gb404fb9-2\\xtensa-lx106-elf\\include", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\tools\\xtensa-lx106-elf-gcc\\1.20.0-26-gb404fb9-2\\lib\\gcc\\xtensa-lx106-elf\\4.8.2\\include", + "${projectRoot}..\\..\\..\\..\\AppData\\Local\\arduino15\\packages\\esp8266\\hardware\\esp8266\\2.4.1\\tools\\sdk\\include" + ], + "defines": [ + "__ESP8266_ESp8266__", + "__ESP8266_ESP8266__", + "__ets__", + "ICACHE_FLASH", + "F_CPU=80000000L", + "LWIP_OPEN_SRC", + "TCP_MSS=536", + "ARDUINO=10807", + "ARDUINO_ESP8266_WEMOS_D1MINI", + "ARDUINO_ARCH_ESP8266", + "ESP8266", + "__cplusplus=201103L", + "_VMICRO_INTELLISENSE" + ] + } + ] +} \ No newline at end of file diff --git a/Fields.h b/Fields.h index c1c868d..f3d9f99 100644 --- a/Fields.h +++ b/Fields.h @@ -81,6 +81,14 @@ String getAutoplayDuration() { return String(autoplayDuration); } +String getAllLeafs() { + return String(allLeafs); +} + +String getSelectedLeaf() { + return String(selectedLeaf); +} + String getSolidColor() { return String(solidColor.r) + "," + String(solidColor.g) + "," + String(solidColor.b); } @@ -114,6 +122,9 @@ FieldList fields = { { "autoplay", "Autoplay", SectionFieldType }, { "autoplay", "Autoplay", BooleanFieldType, 0, 1, getAutoplay }, { "autoplayDuration", "Autoplay Duration", NumberFieldType, 0, 255, getAutoplayDuration }, + { "allLeafs", "Color Leafs", SectionFieldType }, + { "allLeafs", "Color All Leafs", BooleanFieldType, 0, 1, getAllLeafs }, + { "selectedLeaf", "Select Leaf to Color", NumberFieldType, 1, LEAFCOUNT, getSelectedLeaf }, { "solidColor", "Solid Color", SectionFieldType }, { "solidColor", "Color", ColorFieldType, 0, 255, getSolidColor }, { "fire", "Fire & Water", SectionFieldType }, diff --git a/GradientPalettes.h b/GradientPalettes.h index 9928500..fc7f7a6 100644 --- a/GradientPalettes.h +++ b/GradientPalettes.h @@ -10,460 +10,493 @@ // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 16 bytes of program space. -DEFINE_GRADIENT_PALETTE( ib_jul01_gp ) { - 0, 194, 1, 1, - 94, 1, 29, 18, - 132, 57,131, 28, - 255, 113, 1, 1}; +DEFINE_GRADIENT_PALETTE(ib_jul01_gp) { + 0, 194, 1, 1, + 94, 1, 29, 18, + 132, 57, 131, 28, + 255, 113, 1, 1 +}; // Gradient palette "es_vintage_57_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/vintage/tn/es_vintage_57.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 20 bytes of program space. -DEFINE_GRADIENT_PALETTE( es_vintage_57_gp ) { - 0, 2, 1, 1, - 53, 18, 1, 0, - 104, 69, 29, 1, - 153, 167,135, 10, - 255, 46, 56, 4}; +DEFINE_GRADIENT_PALETTE(es_vintage_57_gp) { + 0, 2, 1, 1, + 53, 18, 1, 0, + 104, 69, 29, 1, + 153, 167, 135, 10, + 255, 46, 56, 4 +}; // Gradient palette "es_vintage_01_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/vintage/tn/es_vintage_01.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 32 bytes of program space. -DEFINE_GRADIENT_PALETTE( es_vintage_01_gp ) { - 0, 4, 1, 1, - 51, 16, 0, 1, - 76, 97,104, 3, - 101, 255,131, 19, - 127, 67, 9, 4, - 153, 16, 0, 1, - 229, 4, 1, 1, - 255, 4, 1, 1}; +DEFINE_GRADIENT_PALETTE(es_vintage_01_gp) { + 0, 4, 1, 1, + 51, 16, 0, 1, + 76, 97, 104, 3, + 101, 255, 131, 19, + 127, 67, 9, 4, + 153, 16, 0, 1, + 229, 4, 1, 1, + 255, 4, 1, 1 +}; // Gradient palette "es_rivendell_15_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/rivendell/tn/es_rivendell_15.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 20 bytes of program space. -DEFINE_GRADIENT_PALETTE( es_rivendell_15_gp ) { - 0, 1, 14, 5, - 101, 16, 36, 14, - 165, 56, 68, 30, - 242, 150,156, 99, - 255, 150,156, 99}; +DEFINE_GRADIENT_PALETTE(es_rivendell_15_gp) { + 0, 1, 14, 5, + 101, 16, 36, 14, + 165, 56, 68, 30, + 242, 150, 156, 99, + 255, 150, 156, 99 +}; // Gradient palette "rgi_15_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/ds/rgi/tn/rgi_15.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 36 bytes of program space. -DEFINE_GRADIENT_PALETTE( rgi_15_gp ) { - 0, 4, 1, 31, - 31, 55, 1, 16, - 63, 197, 3, 7, - 95, 59, 2, 17, - 127, 6, 2, 34, - 159, 39, 6, 33, - 191, 112, 13, 32, - 223, 56, 9, 35, - 255, 22, 6, 38}; +DEFINE_GRADIENT_PALETTE(rgi_15_gp) { + 0, 4, 1, 31, + 31, 55, 1, 16, + 63, 197, 3, 7, + 95, 59, 2, 17, + 127, 6, 2, 34, + 159, 39, 6, 33, + 191, 112, 13, 32, + 223, 56, 9, 35, + 255, 22, 6, 38 +}; // Gradient palette "retro2_16_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/ma/retro2/tn/retro2_16.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 8 bytes of program space. -DEFINE_GRADIENT_PALETTE( retro2_16_gp ) { - 0, 188,135, 1, - 255, 46, 7, 1}; +DEFINE_GRADIENT_PALETTE(retro2_16_gp) { + 0, 188, 135, 1, + 255, 46, 7, 1 +}; // Gradient palette "Analogous_1_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/red/tn/Analogous_1.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 20 bytes of program space. -DEFINE_GRADIENT_PALETTE( Analogous_1_gp ) { - 0, 3, 0,255, - 63, 23, 0,255, - 127, 67, 0,255, - 191, 142, 0, 45, - 255, 255, 0, 0}; +DEFINE_GRADIENT_PALETTE(Analogous_1_gp) { + 0, 3, 0, 255, + 63, 23, 0, 255, + 127, 67, 0, 255, + 191, 142, 0, 45, + 255, 255, 0, 0 +}; // Gradient palette "es_pinksplash_08_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/pink_splash/tn/es_pinksplash_08.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 20 bytes of program space. -DEFINE_GRADIENT_PALETTE( es_pinksplash_08_gp ) { - 0, 126, 11,255, - 127, 197, 1, 22, - 175, 210,157,172, - 221, 157, 3,112, - 255, 157, 3,112}; +DEFINE_GRADIENT_PALETTE(es_pinksplash_08_gp) { + 0, 126, 11, 255, + 127, 197, 1, 22, + 175, 210, 157, 172, + 221, 157, 3, 112, + 255, 157, 3, 112 +}; // Gradient palette "es_pinksplash_07_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/pink_splash/tn/es_pinksplash_07.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 28 bytes of program space. -DEFINE_GRADIENT_PALETTE( es_pinksplash_07_gp ) { - 0, 229, 1, 1, - 61, 242, 4, 63, - 101, 255, 12,255, - 127, 249, 81,252, - 153, 255, 11,235, - 193, 244, 5, 68, - 255, 232, 1, 5}; +DEFINE_GRADIENT_PALETTE(es_pinksplash_07_gp) { + 0, 229, 1, 1, + 61, 242, 4, 63, + 101, 255, 12, 255, + 127, 249, 81, 252, + 153, 255, 11, 235, + 193, 244, 5, 68, + 255, 232, 1, 5 +}; // Gradient palette "Coral_reef_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/other/tn/Coral_reef.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 24 bytes of program space. -DEFINE_GRADIENT_PALETTE( Coral_reef_gp ) { - 0, 40,199,197, - 50, 10,152,155, - 96, 1,111,120, - 96, 43,127,162, - 139, 10, 73,111, - 255, 1, 34, 71}; +DEFINE_GRADIENT_PALETTE(Coral_reef_gp) { + 0, 40, 199, 197, + 50, 10, 152, 155, + 96, 1, 111, 120, + 96, 43, 127, 162, + 139, 10, 73, 111, + 255, 1, 34, 71 +}; // Gradient palette "es_ocean_breeze_068_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/ocean_breeze/tn/es_ocean_breeze_068.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 24 bytes of program space. -DEFINE_GRADIENT_PALETTE( es_ocean_breeze_068_gp ) { - 0, 100,156,153, - 51, 1, 99,137, - 101, 1, 68, 84, - 104, 35,142,168, - 178, 0, 63,117, - 255, 1, 10, 10}; +DEFINE_GRADIENT_PALETTE(es_ocean_breeze_068_gp) { + 0, 100, 156, 153, + 51, 1, 99, 137, + 101, 1, 68, 84, + 104, 35, 142, 168, + 178, 0, 63, 117, + 255, 1, 10, 10 +}; // Gradient palette "es_ocean_breeze_036_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/ocean_breeze/tn/es_ocean_breeze_036.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 16 bytes of program space. -DEFINE_GRADIENT_PALETTE( es_ocean_breeze_036_gp ) { - 0, 1, 6, 7, - 89, 1, 99,111, - 153, 144,209,255, - 255, 0, 73, 82}; +DEFINE_GRADIENT_PALETTE(es_ocean_breeze_036_gp) { + 0, 1, 6, 7, + 89, 1, 99, 111, + 153, 144, 209, 255, + 255, 0, 73, 82 +}; // Gradient palette "departure_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/mjf/tn/departure.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 88 bytes of program space. -DEFINE_GRADIENT_PALETTE( departure_gp ) { - 0, 8, 3, 0, - 42, 23, 7, 0, - 63, 75, 38, 6, - 84, 169, 99, 38, - 106, 213,169,119, - 116, 255,255,255, - 138, 135,255,138, - 148, 22,255, 24, - 170, 0,255, 0, - 191, 0,136, 0, - 212, 0, 55, 0, - 255, 0, 55, 0}; +DEFINE_GRADIENT_PALETTE(departure_gp) { + 0, 8, 3, 0, + 42, 23, 7, 0, + 63, 75, 38, 6, + 84, 169, 99, 38, + 106, 213, 169, 119, + 116, 255, 255, 255, + 138, 135, 255, 138, + 148, 22, 255, 24, + 170, 0, 255, 0, + 191, 0, 136, 0, + 212, 0, 55, 0, + 255, 0, 55, 0 +}; // Gradient palette "es_landscape_64_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/landscape/tn/es_landscape_64.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 36 bytes of program space. -DEFINE_GRADIENT_PALETTE( es_landscape_64_gp ) { - 0, 0, 0, 0, - 37, 2, 25, 1, - 76, 15,115, 5, - 127, 79,213, 1, - 128, 126,211, 47, - 130, 188,209,247, - 153, 144,182,205, - 204, 59,117,250, - 255, 1, 37,192}; +DEFINE_GRADIENT_PALETTE(es_landscape_64_gp) { + 0, 0, 0, 0, + 37, 2, 25, 1, + 76, 15, 115, 5, + 127, 79, 213, 1, + 128, 126, 211, 47, + 130, 188, 209, 247, + 153, 144, 182, 205, + 204, 59, 117, 250, + 255, 1, 37, 192 +}; // Gradient palette "es_landscape_33_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/landscape/tn/es_landscape_33.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 24 bytes of program space. -DEFINE_GRADIENT_PALETTE( es_landscape_33_gp ) { - 0, 1, 5, 0, - 19, 32, 23, 1, - 38, 161, 55, 1, - 63, 229,144, 1, - 66, 39,142, 74, - 255, 1, 4, 1}; +DEFINE_GRADIENT_PALETTE(es_landscape_33_gp) { + 0, 1, 5, 0, + 19, 32, 23, 1, + 38, 161, 55, 1, + 63, 229, 144, 1, + 66, 39, 142, 74, + 255, 1, 4, 1 +}; // Gradient palette "rainbowsherbet_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/ma/icecream/tn/rainbowsherbet.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 28 bytes of program space. -DEFINE_GRADIENT_PALETTE( rainbowsherbet_gp ) { - 0, 255, 33, 4, - 43, 255, 68, 25, - 86, 255, 7, 25, - 127, 255, 82,103, - 170, 255,255,242, - 209, 42,255, 22, - 255, 87,255, 65}; +DEFINE_GRADIENT_PALETTE(rainbowsherbet_gp) { + 0, 255, 33, 4, + 43, 255, 68, 25, + 86, 255, 7, 25, + 127, 255, 82, 103, + 170, 255, 255, 242, + 209, 42, 255, 22, + 255, 87, 255, 65 +}; // Gradient palette "gr65_hult_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/hult/tn/gr65_hult.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 24 bytes of program space. -DEFINE_GRADIENT_PALETTE( gr65_hult_gp ) { - 0, 247,176,247, - 48, 255,136,255, - 89, 220, 29,226, - 160, 7, 82,178, - 216, 1,124,109, - 255, 1,124,109}; +DEFINE_GRADIENT_PALETTE(gr65_hult_gp) { + 0, 247, 176, 247, + 48, 255, 136, 255, + 89, 220, 29, 226, + 160, 7, 82, 178, + 216, 1, 124, 109, + 255, 1, 124, 109 +}; // Gradient palette "gr64_hult_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/hult/tn/gr64_hult.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 32 bytes of program space. -DEFINE_GRADIENT_PALETTE( gr64_hult_gp ) { - 0, 1,124,109, - 66, 1, 93, 79, - 104, 52, 65, 1, - 130, 115,127, 1, - 150, 52, 65, 1, - 201, 1, 86, 72, - 239, 0, 55, 45, - 255, 0, 55, 45}; +DEFINE_GRADIENT_PALETTE(gr64_hult_gp) { + 0, 1, 124, 109, + 66, 1, 93, 79, + 104, 52, 65, 1, + 130, 115, 127, 1, + 150, 52, 65, 1, + 201, 1, 86, 72, + 239, 0, 55, 45, + 255, 0, 55, 45 +}; // Gradient palette "GMT_drywet_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/gmt/tn/GMT_drywet.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 28 bytes of program space. -DEFINE_GRADIENT_PALETTE( GMT_drywet_gp ) { - 0, 47, 30, 2, - 42, 213,147, 24, - 84, 103,219, 52, - 127, 3,219,207, - 170, 1, 48,214, - 212, 1, 1,111, - 255, 1, 7, 33}; +DEFINE_GRADIENT_PALETTE(GMT_drywet_gp) { + 0, 47, 30, 2, + 42, 213, 147, 24, + 84, 103, 219, 52, + 127, 3, 219, 207, + 170, 1, 48, 214, + 212, 1, 1, 111, + 255, 1, 7, 33 +}; // Gradient palette "ib15_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/ing/general/tn/ib15.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 24 bytes of program space. -DEFINE_GRADIENT_PALETTE( ib15_gp ) { - 0, 113, 91,147, - 72, 157, 88, 78, - 89, 208, 85, 33, - 107, 255, 29, 11, - 141, 137, 31, 39, - 255, 59, 33, 89}; +DEFINE_GRADIENT_PALETTE(ib15_gp) { + 0, 113, 91, 147, + 72, 157, 88, 78, + 89, 208, 85, 33, + 107, 255, 29, 11, + 141, 137, 31, 39, + 255, 59, 33, 89 +}; // Gradient palette "Fuschia_7_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/ds/fuschia/tn/Fuschia-7.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 20 bytes of program space. -DEFINE_GRADIENT_PALETTE( Fuschia_7_gp ) { - 0, 43, 3,153, - 63, 100, 4,103, - 127, 188, 5, 66, - 191, 161, 11,115, - 255, 135, 20,182}; +DEFINE_GRADIENT_PALETTE(Fuschia_7_gp) { + 0, 43, 3, 153, + 63, 100, 4, 103, + 127, 188, 5, 66, + 191, 161, 11, 115, + 255, 135, 20, 182 +}; // Gradient palette "es_emerald_dragon_08_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/emerald_dragon/tn/es_emerald_dragon_08.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 16 bytes of program space. -DEFINE_GRADIENT_PALETTE( es_emerald_dragon_08_gp ) { - 0, 97,255, 1, - 101, 47,133, 1, - 178, 13, 43, 1, - 255, 2, 10, 1}; +DEFINE_GRADIENT_PALETTE(es_emerald_dragon_08_gp) { + 0, 97, 255, 1, + 101, 47, 133, 1, + 178, 13, 43, 1, + 255, 2, 10, 1 +}; // Gradient palette "lava_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/neota/elem/tn/lava.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 52 bytes of program space. -DEFINE_GRADIENT_PALETTE( lava_gp ) { - 0, 0, 0, 0, - 46, 18, 0, 0, - 96, 113, 0, 0, - 108, 142, 3, 1, - 119, 175, 17, 1, - 146, 213, 44, 2, - 174, 255, 82, 4, - 188, 255,115, 4, - 202, 255,156, 4, - 218, 255,203, 4, - 234, 255,255, 4, - 244, 255,255, 71, - 255, 255,255,255}; +DEFINE_GRADIENT_PALETTE(lava_gp) { + 0, 0, 0, 0, + 46, 18, 0, 0, + 96, 113, 0, 0, + 108, 142, 3, 1, + 119, 175, 17, 1, + 146, 213, 44, 2, + 174, 255, 82, 4, + 188, 255, 115, 4, + 202, 255, 156, 4, + 218, 255, 203, 4, + 234, 255, 255, 4, + 244, 255, 255, 71, + 255, 255, 255, 255 +}; // Gradient palette "fire_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/neota/elem/tn/fire.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 28 bytes of program space. -DEFINE_GRADIENT_PALETTE( fire_gp ) { - 0, 1, 1, 0, - 76, 32, 5, 0, - 146, 192, 24, 0, - 197, 220,105, 5, - 240, 252,255, 31, - 250, 252,255,111, - 255, 255,255,255}; +DEFINE_GRADIENT_PALETTE(fire_gp) { + 0, 1, 1, 0, + 76, 32, 5, 0, + 146, 192, 24, 0, + 197, 220, 105, 5, + 240, 252, 255, 31, + 250, 252, 255, 111, + 255, 255, 255, 255 +}; // Gradient palette "Colorfull_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Colorfull.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 44 bytes of program space. -DEFINE_GRADIENT_PALETTE( Colorfull_gp ) { - 0, 10, 85, 5, - 25, 29,109, 18, - 60, 59,138, 42, - 93, 83, 99, 52, - 106, 110, 66, 64, - 109, 123, 49, 65, - 113, 139, 35, 66, - 116, 192,117, 98, - 124, 255,255,137, - 168, 100,180,155, - 255, 22,121,174}; +DEFINE_GRADIENT_PALETTE(Colorfull_gp) { + 0, 10, 85, 5, + 25, 29, 109, 18, + 60, 59, 138, 42, + 93, 83, 99, 52, + 106, 110, 66, 64, + 109, 123, 49, 65, + 113, 139, 35, 66, + 116, 192, 117, 98, + 124, 255, 255, 137, + 168, 100, 180, 155, + 255, 22, 121, 174 +}; // Gradient palette "Magenta_Evening_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Magenta_Evening.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 28 bytes of program space. -DEFINE_GRADIENT_PALETTE( Magenta_Evening_gp ) { - 0, 71, 27, 39, - 31, 130, 11, 51, - 63, 213, 2, 64, - 70, 232, 1, 66, - 76, 252, 1, 69, - 108, 123, 2, 51, - 255, 46, 9, 35}; +DEFINE_GRADIENT_PALETTE(Magenta_Evening_gp) { + 0, 71, 27, 39, + 31, 130, 11, 51, + 63, 213, 2, 64, + 70, 232, 1, 66, + 76, 252, 1, 69, + 108, 123, 2, 51, + 255, 46, 9, 35 +}; // Gradient palette "Pink_Purple_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Pink_Purple.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 44 bytes of program space. -DEFINE_GRADIENT_PALETTE( Pink_Purple_gp ) { - 0, 19, 2, 39, - 25, 26, 4, 45, - 51, 33, 6, 52, - 76, 68, 62,125, - 102, 118,187,240, - 109, 163,215,247, - 114, 217,244,255, - 122, 159,149,221, - 149, 113, 78,188, - 183, 128, 57,155, - 255, 146, 40,123}; +DEFINE_GRADIENT_PALETTE(Pink_Purple_gp) { + 0, 19, 2, 39, + 25, 26, 4, 45, + 51, 33, 6, 52, + 76, 68, 62, 125, + 102, 118, 187, 240, + 109, 163, 215, 247, + 114, 217, 244, 255, + 122, 159, 149, 221, + 149, 113, 78, 188, + 183, 128, 57, 155, + 255, 146, 40, 123 +}; // Gradient palette "Sunset_Real_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Sunset_Real.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 28 bytes of program space. -DEFINE_GRADIENT_PALETTE( Sunset_Real_gp ) { - 0, 120, 0, 0, - 22, 179, 22, 0, - 51, 255,104, 0, - 85, 167, 22, 18, - 135, 100, 0,103, - 198, 16, 0,130, - 255, 0, 0,160}; +DEFINE_GRADIENT_PALETTE(Sunset_Real_gp) { + 0, 120, 0, 0, + 22, 179, 22, 0, + 51, 255, 104, 0, + 85, 167, 22, 18, + 135, 100, 0, 103, + 198, 16, 0, 130, + 255, 0, 0, 160 +}; // Gradient palette "es_autumn_19_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/autumn/tn/es_autumn_19.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 52 bytes of program space. -DEFINE_GRADIENT_PALETTE( es_autumn_19_gp ) { - 0, 26, 1, 1, - 51, 67, 4, 1, - 84, 118, 14, 1, - 104, 137,152, 52, - 112, 113, 65, 1, - 122, 133,149, 59, - 124, 137,152, 52, - 135, 113, 65, 1, - 142, 139,154, 46, - 163, 113, 13, 1, - 204, 55, 3, 1, - 249, 17, 1, 1, - 255, 17, 1, 1}; +DEFINE_GRADIENT_PALETTE(es_autumn_19_gp) { + 0, 26, 1, 1, + 51, 67, 4, 1, + 84, 118, 14, 1, + 104, 137, 152, 52, + 112, 113, 65, 1, + 122, 133, 149, 59, + 124, 137, 152, 52, + 135, 113, 65, 1, + 142, 139, 154, 46, + 163, 113, 13, 1, + 204, 55, 3, 1, + 249, 17, 1, 1, + 255, 17, 1, 1 +}; // Gradient palette "BlacK_Blue_Magenta_White_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/basic/tn/BlacK_Blue_Magenta_White.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 28 bytes of program space. -DEFINE_GRADIENT_PALETTE( BlacK_Blue_Magenta_White_gp ) { - 0, 0, 0, 0, - 42, 0, 0, 45, - 84, 0, 0,255, - 127, 42, 0,255, - 170, 255, 0,255, - 212, 255, 55,255, - 255, 255,255,255}; +DEFINE_GRADIENT_PALETTE(BlacK_Blue_Magenta_White_gp) { + 0, 0, 0, 0, + 42, 0, 0, 45, + 84, 0, 0, 255, + 127, 42, 0, 255, + 170, 255, 0, 255, + 212, 255, 55, 255, + 255, 255, 255, 255 +}; // Gradient palette "BlacK_Magenta_Red_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/basic/tn/BlacK_Magenta_Red.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 20 bytes of program space. -DEFINE_GRADIENT_PALETTE( BlacK_Magenta_Red_gp ) { - 0, 0, 0, 0, - 63, 42, 0, 45, - 127, 255, 0,255, - 191, 255, 0, 45, - 255, 255, 0, 0}; +DEFINE_GRADIENT_PALETTE(BlacK_Magenta_Red_gp) { + 0, 0, 0, 0, + 63, 42, 0, 45, + 127, 255, 0, 255, + 191, 255, 0, 45, + 255, 255, 0, 0 +}; // Gradient palette "BlacK_Red_Magenta_Yellow_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/basic/tn/BlacK_Red_Magenta_Yellow.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 28 bytes of program space. -DEFINE_GRADIENT_PALETTE( BlacK_Red_Magenta_Yellow_gp ) { - 0, 0, 0, 0, - 42, 42, 0, 0, - 84, 255, 0, 0, - 127, 255, 0, 45, - 170, 255, 0,255, - 212, 255, 55, 45, - 255, 255,255, 0}; +DEFINE_GRADIENT_PALETTE(BlacK_Red_Magenta_Yellow_gp) { + 0, 0, 0, 0, + 42, 42, 0, 0, + 84, 255, 0, 0, + 127, 255, 0, 45, + 170, 255, 0, 255, + 212, 255, 55, 45, + 255, 255, 255, 0 +}; // Gradient palette "Blue_Cyan_Yellow_gp", originally from // http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/basic/tn/Blue_Cyan_Yellow.png.index.html // converted for FastLED with gammas (2.6, 2.2, 2.5) // Size: 20 bytes of program space. -DEFINE_GRADIENT_PALETTE( Blue_Cyan_Yellow_gp ) { - 0, 0, 0,255, - 63, 0, 55,255, - 127, 0,255,255, - 191, 42,255, 45, - 255, 255,255, 0}; +DEFINE_GRADIENT_PALETTE(Blue_Cyan_Yellow_gp) { + 0, 0, 0, 255, + 63, 0, 55, 255, + 127, 0, 255, 255, + 191, 42, 255, 45, + 255, 255, 255, 0 +}; // Single array of defined cpt-city color palettes. @@ -514,5 +547,5 @@ const TProgmemRGBGradientPalettePtr gGradientPalettes[] = { // Count of how many cpt-city gradients are defined: const uint8_t gGradientPaletteCount = - sizeof( gGradientPalettes) / sizeof( TProgmemRGBGradientPalettePtr ); +sizeof(gGradientPalettes) / sizeof(TProgmemRGBGradientPalettePtr); diff --git a/TwinkleFOX.h b/TwinkleFOX.h index e784a88..90db777 100644 --- a/TwinkleFOX.h +++ b/TwinkleFOX.h @@ -99,26 +99,27 @@ CRGBPalette16 twinkleFoxPalette; // / \ // -uint8_t attackDecayWave8( uint8_t i) +uint8_t attackDecayWave8(uint8_t i) { - if( i < 86) { + if (i < 86) { return i * 3; - } else { + } + else { i -= 86; - return 255 - (i + (i/2)); + return 255 - (i + (i / 2)); } } // This function takes a pixel, and if its in the 'fading down' // part of the cycle, it adjusts the color a little bit like the // way that incandescent bulbs fade toward 'red' as they dim. -void coolLikeIncandescent( CRGB& c, uint8_t phase) +void coolLikeIncandescent(CRGB& c, uint8_t phase) { - if( phase < 128) return; + if (phase < 128) return; uint8_t cooling = (phase - 128) >> 4; - c.g = qsub8( c.g, cooling); - c.b = qsub8( c.b, cooling * 2); + c.g = qsub8(c.g, cooling); + c.b = qsub8(c.b, cooling * 2); } // This function takes a time in pseudo-milliseconds, @@ -130,28 +131,29 @@ void coolLikeIncandescent( CRGB& c, uint8_t phase) // of one cycle of the brightness wave function. // The 'high digits' are also used to determine whether this pixel // should light at all during this cycle, based on the twinkleDensity. -CRGB computeOneTwinkle( uint32_t ms, uint8_t salt) +CRGB computeOneTwinkle(uint32_t ms, uint8_t salt) { - uint16_t ticks = ms >> (8-twinkleSpeed); + uint16_t ticks = ms >> (8 - twinkleSpeed); uint8_t fastcycle8 = ticks; uint16_t slowcycle16 = (ticks >> 8) + salt; - slowcycle16 += sin8( slowcycle16); - slowcycle16 = (slowcycle16 * 2053) + 1384; + slowcycle16 += sin8(slowcycle16); + slowcycle16 = (slowcycle16 * 2053) + 1384; uint8_t slowcycle8 = (slowcycle16 & 0xFF) + (slowcycle16 >> 8); uint8_t bright = 0; - if( ((slowcycle8 & 0x0E)/2) < twinkleDensity) { - bright = attackDecayWave8( fastcycle8); + if (((slowcycle8 & 0x0E) / 2) < twinkleDensity) { + bright = attackDecayWave8(fastcycle8); } uint8_t hue = slowcycle8 - salt; CRGB c; - if( bright > 0) { - c = ColorFromPalette( twinkleFoxPalette, hue, bright, NOBLEND); - if( COOL_LIKE_INCANDESCENT == 1 ) { - coolLikeIncandescent( c, fastcycle8); + if (bright > 0) { + c = ColorFromPalette(twinkleFoxPalette, hue, bright, NOBLEND); + if (COOL_LIKE_INCANDESCENT == 1) { + coolLikeIncandescent(c, fastcycle8); } - } else { + } + else { c = CRGB::Black; } return c; @@ -177,61 +179,148 @@ void drawTwinkles() // the current palette are identical, then a deeply faded version of // that color is used for the background color CRGB bg; - if( (AUTO_SELECT_BACKGROUND_COLOR == 1) && - (twinkleFoxPalette[0] == twinkleFoxPalette[1] )) { + if ((AUTO_SELECT_BACKGROUND_COLOR == 1) && + (twinkleFoxPalette[0] == twinkleFoxPalette[1])) { bg = twinkleFoxPalette[0]; uint8_t bglight = bg.getAverageLight(); - if( bglight > 64) { - bg.nscale8_video( 16); // very bright, so scale to 1/16th - } else if( bglight > 16) { - bg.nscale8_video( 64); // not that bright, so scale to 1/4th - } else { - bg.nscale8_video( 86); // dim, scale to 1/3rd. + if (bglight > 64) { + bg.nscale8_video(16); // very bright, so scale to 1/16th } - } else { + else if (bglight > 16) { + bg.nscale8_video(64); // not that bright, so scale to 1/4th + } + else { + bg.nscale8_video(86); // dim, scale to 1/3rd. + } + } + else { bg = gBackgroundColor; // just use the explicitly defined background color } uint8_t backgroundBrightness = bg.getAverageLight(); - for(uint16_t i = 0; i < NUM_LEDS; i++) { - CRGB& pixel = leds[i]; + for (uint16_t i = 0; i < LEAFCOUNT; i++) { + CRGB& pixel = leds[i*PIXELS_PER_LEAF]; PRNG16 = (uint16_t)(PRNG16 * 2053) + 1384; // next 'random' number - uint16_t myclockoffset16= PRNG16; // use that number as clock offset + uint16_t myclockoffset16 = PRNG16; // use that number as clock offset PRNG16 = (uint16_t)(PRNG16 * 2053) + 1384; // next 'random' number // use that number as clock speed adjustment factor (in 8ths, from 8/8ths to 23/8ths) - uint8_t myspeedmultiplierQ5_3 = ((((PRNG16 & 0xFF)>>4) + (PRNG16 & 0x0F)) & 0x0F) + 0x08; + uint8_t myspeedmultiplierQ5_3 = ((((PRNG16 & 0xFF) >> 4) + (PRNG16 & 0x0F)) & 0x0F) + 0x08; uint32_t myclock30 = (uint32_t)((clock32 * myspeedmultiplierQ5_3) >> 3) + myclockoffset16; uint8_t myunique8 = PRNG16 >> 8; // get 'salt' value for this pixel // We now have the adjusted 'clock' for this pixel, now we call // the function that computes what color the pixel should be based // on the "brightness = f( time )" idea. - CRGB c = computeOneTwinkle( myclock30, myunique8); + CRGB c = computeOneTwinkle(myclock30, myunique8); uint8_t cbright = c.getAverageLight(); int16_t deltabright = cbright - backgroundBrightness; - if( deltabright >= 32 || (!bg)) { + if (deltabright >= 32 || (!bg)) { + // If the new pixel is significantly brighter than the background color, + // use the new color. + fill_solid(leds + i * PIXELS_PER_LEAF, PIXELS_PER_LEAF, c); + //Serial.printf("rgb: %d, %d, %d\n", c.r,c.g,c.b); + } + else if (deltabright > 0) { + // If the new pixel is just slightly brighter than the background color, + // mix a blend of the new color and the background color + fill_solid(leds + i * PIXELS_PER_LEAF, PIXELS_PER_LEAF, blend(bg, c, deltabright * 8)); + //Serial.println("rgb:"+ blend(bg, c, deltabright * 8)); + } + else { + // if the new pixel is not at all brighter than the background color, + // just use the background color. + fill_solid(leds + i * PIXELS_PER_LEAF, PIXELS_PER_LEAF, bg); + //Serial.println("rgb:" + bg); + } + } +} + +/////// #############################BACKUP#################################### +/* +// This function loops over each pixel, calculates the +// adjusted 'clock' that this pixel should use, and calls +// "CalculateOneTwinkle" on each pixel. It then displays +// either the twinkle color of the background color, +// whichever is brighter. +void drawTwinkles() +{ + // "PRNG16" is the pseudorandom number generator + // It MUST be reset to the same starting value each time + // this function is called, so that the sequence of 'random' + // numbers that it generates is (paradoxically) stable. + uint16_t PRNG16 = 11337; + + uint32_t clock32 = millis(); + + // Set up the background color, "bg". + // if AUTO_SELECT_BACKGROUND_COLOR == 1, and the first two colors of + // the current palette are identical, then a deeply faded version of + // that color is used for the background color + CRGB bg; + if ((AUTO_SELECT_BACKGROUND_COLOR == 1) && + (twinkleFoxPalette[0] == twinkleFoxPalette[1])) { + bg = twinkleFoxPalette[0]; + uint8_t bglight = bg.getAverageLight(); + if (bglight > 64) { + bg.nscale8_video(16); // very bright, so scale to 1/16th + } + else if (bglight > 16) { + bg.nscale8_video(64); // not that bright, so scale to 1/4th + } + else { + bg.nscale8_video(86); // dim, scale to 1/3rd. + } + } + else { + bg = gBackgroundColor; // just use the explicitly defined background color + } + + uint8_t backgroundBrightness = bg.getAverageLight(); + + for (uint16_t i = 0; i < NUM_LEDS; i++) { + CRGB& pixel = leds[i]; + + PRNG16 = (uint16_t)(PRNG16 * 2053) + 1384; // next 'random' number + uint16_t myclockoffset16 = PRNG16; // use that number as clock offset + PRNG16 = (uint16_t)(PRNG16 * 2053) + 1384; // next 'random' number + // use that number as clock speed adjustment factor (in 8ths, from 8/8ths to 23/8ths) + uint8_t myspeedmultiplierQ5_3 = ((((PRNG16 & 0xFF) >> 4) + (PRNG16 & 0x0F)) & 0x0F) + 0x08; + uint32_t myclock30 = (uint32_t)((clock32 * myspeedmultiplierQ5_3) >> 3) + myclockoffset16; + uint8_t myunique8 = PRNG16 >> 8; // get 'salt' value for this pixel + + // We now have the adjusted 'clock' for this pixel, now we call + // the function that computes what color the pixel should be based + // on the "brightness = f( time )" idea. + CRGB c = computeOneTwinkle(myclock30, myunique8); + + uint8_t cbright = c.getAverageLight(); + int16_t deltabright = cbright - backgroundBrightness; + if (deltabright >= 32 || (!bg)) { // If the new pixel is significantly brighter than the background color, // use the new color. pixel = c; - } else if( deltabright > 0 ) { + } + else if (deltabright > 0) { // If the new pixel is just slightly brighter than the background color, // mix a blend of the new color and the background color - pixel = blend( bg, c, deltabright * 8); - } else { + pixel = blend(bg, c, deltabright * 8); + } + else { // if the new pixel is not at all brighter than the background color, // just use the background color. pixel = bg; } } } +*/ // A mostly red palette with green accents and white trim. // "CRGB::Gray" is used as white to keep the brightness more uniform. const TProgmemRGBPalette16 RedGreenWhite_p FL_PROGMEM = -{ CRGB::Red, CRGB::Red, CRGB::Red, CRGB::Red, +{ CRGB::Red, CRGB::Red, CRGB::Red, CRGB::Red, CRGB::Red, CRGB::Red, CRGB::Red, CRGB::Red, CRGB::Red, CRGB::Red, CRGB::Gray, CRGB::Gray, CRGB::Green, CRGB::Green, CRGB::Green, CRGB::Green }; @@ -240,7 +329,7 @@ const TProgmemRGBPalette16 RedGreenWhite_p FL_PROGMEM = #define Holly_Green 0x00580c #define Holly_Red 0xB00402 const TProgmemRGBPalette16 Holly_p FL_PROGMEM = -{ Holly_Green, Holly_Green, Holly_Green, Holly_Green, +{ Holly_Green, Holly_Green, Holly_Green, Holly_Green, Holly_Green, Holly_Green, Holly_Green, Holly_Green, Holly_Green, Holly_Green, Holly_Green, Holly_Green, Holly_Green, Holly_Green, Holly_Green, Holly_Red @@ -249,7 +338,7 @@ const TProgmemRGBPalette16 Holly_p FL_PROGMEM = // A red and white striped palette // "CRGB::Gray" is used as white to keep the brightness more uniform. const TProgmemRGBPalette16 RedWhite_p FL_PROGMEM = -{ CRGB::Red, CRGB::Red, CRGB::Gray, CRGB::Gray, +{ CRGB::Red, CRGB::Red, CRGB::Gray, CRGB::Gray, CRGB::Red, CRGB::Red, CRGB::Gray, CRGB::Gray, CRGB::Red, CRGB::Red, CRGB::Gray, CRGB::Gray, CRGB::Red, CRGB::Red, CRGB::Gray, CRGB::Gray }; @@ -257,7 +346,7 @@ const TProgmemRGBPalette16 RedWhite_p FL_PROGMEM = // A mostly blue palette with white accents. // "CRGB::Gray" is used as white to keep the brightness more uniform. const TProgmemRGBPalette16 BlueWhite_p FL_PROGMEM = -{ CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Blue, +{ CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Blue, CRGB::Gray, CRGB::Gray, CRGB::Gray }; @@ -266,14 +355,14 @@ const TProgmemRGBPalette16 BlueWhite_p FL_PROGMEM = #define HALFFAIRY ((CRGB::FairyLight & 0xFEFEFE) / 2) #define QUARTERFAIRY ((CRGB::FairyLight & 0xFCFCFC) / 4) const TProgmemRGBPalette16 FairyLight_p FL_PROGMEM = -{ CRGB::FairyLight, CRGB::FairyLight, CRGB::FairyLight, CRGB::FairyLight, +{ CRGB::FairyLight, CRGB::FairyLight, CRGB::FairyLight, CRGB::FairyLight, HALFFAIRY, HALFFAIRY, CRGB::FairyLight, CRGB::FairyLight, QUARTERFAIRY, QUARTERFAIRY, CRGB::FairyLight, CRGB::FairyLight, CRGB::FairyLight, CRGB::FairyLight, CRGB::FairyLight, CRGB::FairyLight }; // A palette of soft snowflakes with the occasional bright one const TProgmemRGBPalette16 Snow_p FL_PROGMEM = -{ 0x304048, 0x304048, 0x304048, 0x304048, +{ 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0x304048, 0xE0F0FF }; @@ -286,7 +375,7 @@ const TProgmemRGBPalette16 Snow_p FL_PROGMEM = #define C9_Blue 0x070758 #define C9_White 0x606820 const TProgmemRGBPalette16 RetroC9_p FL_PROGMEM = -{ C9_Red, C9_Orange, C9_Red, C9_Orange, +{ C9_Red, C9_Orange, C9_Red, C9_Orange, C9_Orange, C9_Red, C9_Orange, C9_Red, C9_Green, C9_Green, C9_Green, C9_Green, C9_Blue, C9_Blue, C9_Blue, diff --git a/Twinkles.h b/Twinkles.h index bcc5d6a..efc4bb9 100644 --- a/Twinkles.h +++ b/Twinkles.h @@ -7,17 +7,17 @@ enum { GETTING_DARKER = 0, GETTING_BRIGHTER = 1 }; -CRGB makeBrighter( const CRGB& color, fract8 howMuchBrighter) +CRGB makeBrighter(const CRGB& color, fract8 howMuchBrighter) { CRGB incrementalColor = color; - incrementalColor.nscale8( howMuchBrighter); + incrementalColor.nscale8(howMuchBrighter); return color + incrementalColor; } -CRGB makeDarker( const CRGB& color, fract8 howMuchDarker) +CRGB makeDarker(const CRGB& color, fract8 howMuchDarker) { CRGB newcolor = color; - newcolor.nscale8( 255 - howMuchDarker); + newcolor.nscale8(255 - howMuchDarker); return newcolor; } @@ -26,9 +26,9 @@ CRGB makeDarker( const CRGB& color, fract8 howMuchDarker) // per pixel. This requires a bunch of bit wrangling, // but conserves precious RAM. The cost is a few // cycles and about 100 bytes of flash program memory. -uint8_t directionFlags[ (NUM_LEDS + 7) / 8]; +uint8_t directionFlags[(NUM_LEDS + 7) / 8]; -bool getPixelDirection( uint16_t i) +bool getPixelDirection(uint16_t i) { uint16_t index = i / 8; uint8_t bitNum = i & 0x07; @@ -37,7 +37,7 @@ bool getPixelDirection( uint16_t i) return (directionFlags[index] & andMask) != 0; } -void setPixelDirection( uint16_t i, bool dir) +void setPixelDirection(uint16_t i, bool dir) { uint16_t index = i / 8; uint8_t bitNum = i & 0x07; @@ -45,25 +45,26 @@ void setPixelDirection( uint16_t i, bool dir) uint8_t orMask = 1 << bitNum; uint8_t andMask = 255 - orMask; uint8_t value = directionFlags[index] & andMask; - if ( dir ) { + if (dir) { value += orMask; } directionFlags[index] = value; } -void brightenOrDarkenEachPixel( fract8 fadeUpAmount, fract8 fadeDownAmount) +void brightenOrDarkenEachPixel(fract8 fadeUpAmount, fract8 fadeDownAmount) { - for ( uint16_t i = 0; i < NUM_LEDS; i++) { - if ( getPixelDirection(i) == GETTING_DARKER) { + for (uint16_t i = 0; i < LEAFCOUNT; i++) { + if (getPixelDirection(i*PIXELS_PER_LEAF) == GETTING_DARKER) { // This pixel is getting darker - leds[i] = makeDarker( leds[i], fadeDownAmount); - } else { + for (int i2 = 0; i2 < PIXELS_PER_LEAF; i2++)leds[i*PIXELS_PER_LEAF + i2] = makeDarker(leds[i*PIXELS_PER_LEAF + i2], fadeDownAmount); + } + else { // This pixel is getting brighter - leds[i] = makeBrighter( leds[i], fadeUpAmount); + for (int i2 = 0; i2 < PIXELS_PER_LEAF; i2++)leds[i*PIXELS_PER_LEAF + i2] = makeBrighter(leds[i*PIXELS_PER_LEAF + i2], fadeUpAmount); // now check to see if we've maxxed out the brightness - if ( leds[i].r == 255 || leds[i].g == 255 || leds[i].b == 255) { + if (leds[i*PIXELS_PER_LEAF].r == 255 || leds[i*PIXELS_PER_LEAF].g == 255 || leds[i*PIXELS_PER_LEAF].b == 255) { // if so, turn around and start getting darker - setPixelDirection(i, GETTING_DARKER); + for (int i2 = 0; i2 < PIXELS_PER_LEAF; i2++)setPixelDirection(i*PIXELS_PER_LEAF + i2, GETTING_DARKER); } } } @@ -75,14 +76,18 @@ void colortwinkles() { // Make each pixel brighter or darker, depending on // its 'direction' flag. - brightenOrDarkenEachPixel( FADE_IN_SPEED, FADE_OUT_SPEED); - + brightenOrDarkenEachPixel(FADE_IN_SPEED, FADE_OUT_SPEED); + // Now consider adding a new random twinkle - if ( random8() < DENSITY ) { - int pos = random16(NUM_LEDS); - if ( !leds[pos]) { - leds[pos] = ColorFromPalette( gCurrentPalette, random8(), STARTING_BRIGHTNESS, NOBLEND); - setPixelDirection(pos, GETTING_BRIGHTER); + if (random8() < DENSITY) { + int pos = random16(LEAFCOUNT); + if (!leds[pos]) { + uint8_t rdo = random8(); + for (int i = 0; i < PIXELS_PER_LEAF; i++) + { + leds[pos*PIXELS_PER_LEAF + i] = ColorFromPalette(gCurrentPalette, rdo, STARTING_BRIGHTNESS, NOBLEND); + setPixelDirection(pos*PIXELS_PER_LEAF + i, GETTING_BRIGHTER); + } } } } @@ -104,7 +109,7 @@ void snowTwinkles() { CRGB w(85, 85, 85), W(CRGB::White); - gCurrentPalette = CRGBPalette16( W, W, W, W, w, w, w, w, w, w, w, w, w, w, w, w ); + gCurrentPalette = CRGBPalette16(W, W, W, W, w, w, w, w, w, w, w, w, w, w, w, w); colortwinkles(); } @@ -112,7 +117,7 @@ void incandescentTwinkles() { CRGB l(0xE1A024); - gCurrentPalette = CRGBPalette16( l, l, l, l, l, l, l, l, l, l, l, l, l, l, l, l ); + gCurrentPalette = CRGBPalette16(l, l, l, l, l, l, l, l, l, l, l, l, l, l, l, l); colortwinkles(); } diff --git a/data/index.htm b/data/index.htm index 296c1ce..e344eb6 100644 --- a/data/index.htm +++ b/data/index.htm @@ -1,27 +1,20 @@ - + - ESP8266 + FastLED by Evil Genius Labs - - - - - - -
- -
-
- +
- -
@@ -107,8 +91,36 @@
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ + +
+
+
+
@@ -153,7 +165,6 @@
-
@@ -189,9 +200,7 @@
- - - - - - - diff --git a/esp8266-fastled-webserver.ino b/esp8266-fastled-webserver.ino index ae12f61..21166d5 100644 --- a/esp8266-fastled-webserver.ino +++ b/esp8266-fastled-webserver.ino @@ -16,6 +16,40 @@ along with this program. If not, see . */ + +//-----------------------------------------CONFIG-----------------------------------------// +#define LEAFCOUNT 12 +#define PIXELS_PER_LEAF 12 + +#define DATA_PIN D4 // The pin where the data line is connected to +#define LED_TYPE WS2812B +#define COLOR_ORDER GRB // Color order, if e.g. your Colors are swapped then change the order, (RGB, RBG, GBR, GRB, BRG, BGR) + +#define MILLI_AMPS 3000 // IMPORTANT: set the max milli-Amps of your power supply (4A = 4000mA) +#define FRAMES_PER_SECOND 120 // here you can control the speed. With the Access Point / Web Server the animations run a bit slower. +const bool apMode = false; // Set to true if the esp8266 should open an Access-Point + + +// Animation Config: +// ten seconds per color palette makes a good demo +// 20-120 is better for deployment +uint8_t secondsPerPalette = 60; + +// COOLING: How much does the air cool as it rises? +// Less cooling = taller flames. More cooling = shorter flames. +// Default 50, suggested range 20-100 +uint8_t cooling = 49; + +// SPARKING: What chance (out of 255) is there that a new spark will be lit? +// Higher chance = more roaring fire. Lower chance = more flickery fire. +// Default 120, suggested range 50-200. +uint8_t sparking = 160; + +uint8_t speed = 20; +//---------------------------------------CONFIG END---------------------------------------// + + + //#define FASTLED_ALLOW_INTERRUPTS 1 //#define INTERRUPT_THRESHOLD 1 #define FASTLED_INTERRUPT_RETRY_COUNT 0 @@ -52,15 +86,9 @@ ESP8266HTTPUpdateServer httpUpdateServer; #include "FSBrowser.h" -#define DATA_PIN D5 -#define LED_TYPE WS2811 -#define COLOR_ORDER RGB -#define NUM_LEDS 200 -#define MILLI_AMPS 2000 // IMPORTANT: set the max milli-Amps of your power supply (4A = 4000mA) -#define FRAMES_PER_SECOND 120 // here you can control the speed. With the Access Point / Web Server the animations run a bit slower. +#define NUM_LEDS (PIXELS_PER_LEAF * LEAFCOUNT) -const bool apMode = false; #include "Secrets.h" // this file is intentionally not included in the sketch, so nobody accidentally commits their secret information. // create a Secrets.h file with the following: @@ -79,21 +107,7 @@ const uint8_t brightnessCount = 5; uint8_t brightnessMap[brightnessCount] = { 16, 32, 64, 128, 255 }; uint8_t brightnessIndex = 0; -// ten seconds per color palette makes a good demo -// 20-120 is better for deployment -uint8_t secondsPerPalette = 10; -// COOLING: How much does the air cool as it rises? -// Less cooling = taller flames. More cooling = shorter flames. -// Default 50, suggested range 20-100 -uint8_t cooling = 49; - -// SPARKING: What chance (out of 255) is there that a new spark will be lit? -// Higher chance = more roaring fire. Lower chance = more flickery fire. -// Default 120, suggested range 50-200. -uint8_t sparking = 60; - -uint8_t speed = 30; /////////////////////////////////////////////////////////////////////// @@ -104,14 +118,17 @@ extern const TProgmemRGBGradientPalettePtr gGradientPalettes[]; uint8_t gCurrentPaletteNumber = 0; -CRGBPalette16 gCurrentPalette( CRGB::Black); -CRGBPalette16 gTargetPalette( gGradientPalettes[0] ); +CRGBPalette16 gCurrentPalette(CRGB::Black); +CRGBPalette16 gTargetPalette(gGradientPalettes[0]); CRGBPalette16 IceColors_p = CRGBPalette16(CRGB::Black, CRGB::Blue, CRGB::Aqua, CRGB::White); uint8_t currentPatternIndex = 0; // Index number of which pattern is current uint8_t autoplay = 0; +uint8_t allLeafs = 1; // Sets if all leafs should get the same color +uint8_t selectedLeaf = 1; // Sets position of leaf to color + uint8_t autoplayDuration = 10; unsigned long autoPlayTimeout = 0; @@ -129,7 +146,7 @@ void dimAll(byte value) } } -typedef void (*Pattern)(); +typedef void(*Pattern)(); typedef Pattern PatternList[]; typedef struct { Pattern pattern; @@ -223,7 +240,6 @@ void setup() { Serial.setDebugOutput(true); FastLED.addLeds(leds, NUM_LEDS); // for WS2812 (Neopixel) - //FastLED.addLeds(leds, NUM_LEDS); // for APA102 (Dotstar) FastLED.setDither(false); FastLED.setCorrection(TypicalLEDStrip); FastLED.setBrightness(brightness); @@ -239,14 +255,14 @@ void setup() { // irReceiver.enableIRIn(); // Start the receiver Serial.println(); - Serial.print( F("Heap: ") ); Serial.println(system_get_free_heap_size()); - Serial.print( F("Boot Vers: ") ); Serial.println(system_get_boot_version()); - Serial.print( F("CPU: ") ); Serial.println(system_get_cpu_freq()); - Serial.print( F("SDK: ") ); Serial.println(system_get_sdk_version()); - Serial.print( F("Chip ID: ") ); Serial.println(system_get_chip_id()); - Serial.print( F("Flash ID: ") ); Serial.println(spi_flash_get_id()); - Serial.print( F("Flash Size: ") ); Serial.println(ESP.getFlashChipRealSize()); - Serial.print( F("Vcc: ") ); Serial.println(ESP.getVcc()); + Serial.print(F("Heap: ")); Serial.println(system_get_free_heap_size()); + Serial.print(F("Boot Vers: ")); Serial.println(system_get_boot_version()); + Serial.print(F("CPU: ")); Serial.println(system_get_cpu_freq()); + Serial.print(F("SDK: ")); Serial.println(system_get_sdk_version()); + Serial.print(F("Chip ID: ")); Serial.println(system_get_chip_id()); + Serial.print(F("Flash ID: ")); Serial.println(spi_flash_get_id()); + Serial.print(F("Flash Size: ")); Serial.println(ESP.getFlashChipRealSize()); + Serial.print(F("Vcc: ")); Serial.println(ESP.getVcc()); Serial.println(); SPIFFS.begin(); @@ -274,7 +290,7 @@ void setup() { uint8_t mac[WL_MAC_ADDR_LENGTH]; WiFi.softAPmacAddress(mac); String macID = String(mac[WL_MAC_ADDR_LENGTH - 2], HEX) + - String(mac[WL_MAC_ADDR_LENGTH - 1], HEX); + String(mac[WL_MAC_ADDR_LENGTH - 1], HEX); macID.toUpperCase(); String AP_NameString = "ESP8266 Thing " + macID; @@ -413,6 +429,18 @@ void setup() { sendInt(autoplayDuration); }); + webServer.on("/allLeafs", HTTP_POST, []() { + String value = webServer.arg("value"); + setAllLeafs(value.toInt()); + sendInt(allLeafs); + }); + + webServer.on("/selectedLeaf", HTTP_POST, []() { + String value = webServer.arg("value"); + setSelectedLeaf(value.toInt()); + sendInt(selectedLeaf); + }); + //list directory webServer.on("/list", HTTP_GET, handleFileList); //load editor @@ -499,14 +527,14 @@ void loop() { // } // change to a new cpt-city gradient palette - EVERY_N_SECONDS( secondsPerPalette ) { - gCurrentPaletteNumber = addmod8( gCurrentPaletteNumber, 1, gGradientPaletteCount); - gTargetPalette = gGradientPalettes[ gCurrentPaletteNumber ]; + EVERY_N_SECONDS(secondsPerPalette) { + gCurrentPaletteNumber = addmod8(gCurrentPaletteNumber, 1, gGradientPaletteCount); + gTargetPalette = gGradientPalettes[gCurrentPaletteNumber]; } - EVERY_N_MILLISECONDS(40) { + EVERY_N_MILLISECONDS(80) { // slowly blend the current palette to the next - nblendPaletteTowardPalette( gCurrentPalette, gTargetPalette, 8); + nblendPaletteTowardPalette(gCurrentPalette, gTargetPalette, 8); gHue++; // slowly cycle the "base color" through the rainbow } @@ -561,212 +589,7 @@ void loop() { // } //} -//void handleIrInput() -//{ -// InputCommand command = readCommand(); -// -// if (command != InputCommand::None) { -// Serial.print("command: "); -// Serial.println((int) command); -// } -// -// switch (command) { -// case InputCommand::Up: { -// adjustPattern(true); -// break; -// } -// case InputCommand::Down: { -// adjustPattern(false); -// break; -// } -// case InputCommand::Power: { -// setPower(power == 0 ? 1 : 0); -// break; -// } -// case InputCommand::BrightnessUp: { -// adjustBrightness(true); -// break; -// } -// case InputCommand::BrightnessDown: { -// adjustBrightness(false); -// break; -// } -// case InputCommand::PlayMode: { // toggle pause/play -// setAutoplay(!autoplay); -// break; -// } -// -// // pattern buttons -// -// case InputCommand::Pattern1: { -// setPattern(0); -// break; -// } -// case InputCommand::Pattern2: { -// setPattern(1); -// break; -// } -// case InputCommand::Pattern3: { -// setPattern(2); -// break; -// } -// case InputCommand::Pattern4: { -// setPattern(3); -// break; -// } -// case InputCommand::Pattern5: { -// setPattern(4); -// break; -// } -// case InputCommand::Pattern6: { -// setPattern(5); -// break; -// } -// case InputCommand::Pattern7: { -// setPattern(6); -// break; -// } -// case InputCommand::Pattern8: { -// setPattern(7); -// break; -// } -// case InputCommand::Pattern9: { -// setPattern(8); -// break; -// } -// case InputCommand::Pattern10: { -// setPattern(9); -// break; -// } -// case InputCommand::Pattern11: { -// setPattern(10); -// break; -// } -// case InputCommand::Pattern12: { -// setPattern(11); -// break; -// } -// -// // custom color adjustment buttons -// -// case InputCommand::RedUp: { -// solidColor.red += 8; -// setSolidColor(solidColor); -// break; -// } -// case InputCommand::RedDown: { -// solidColor.red -= 8; -// setSolidColor(solidColor); -// break; -// } -// case InputCommand::GreenUp: { -// solidColor.green += 8; -// setSolidColor(solidColor); -// break; -// } -// case InputCommand::GreenDown: { -// solidColor.green -= 8; -// setSolidColor(solidColor); -// break; -// } -// case InputCommand::BlueUp: { -// solidColor.blue += 8; -// setSolidColor(solidColor); -// break; -// } -// case InputCommand::BlueDown: { -// solidColor.blue -= 8; -// setSolidColor(solidColor); -// break; -// } -// -// // color buttons -// -// case InputCommand::Red: { -// setSolidColor(CRGB::Red); -// break; -// } -// case InputCommand::RedOrange: { -// setSolidColor(CRGB::OrangeRed); -// break; -// } -// case InputCommand::Orange: { -// setSolidColor(CRGB::Orange); -// break; -// } -// case InputCommand::YellowOrange: { -// setSolidColor(CRGB::Goldenrod); -// break; -// } -// case InputCommand::Yellow: { -// setSolidColor(CRGB::Yellow); -// break; -// } -// -// case InputCommand::Green: { -// setSolidColor(CRGB::Green); -// break; -// } -// case InputCommand::Lime: { -// setSolidColor(CRGB::Lime); -// break; -// } -// case InputCommand::Aqua: { -// setSolidColor(CRGB::Aqua); -// break; -// } -// case InputCommand::Teal: { -// setSolidColor(CRGB::Teal); -// break; -// } -// case InputCommand::Navy: { -// setSolidColor(CRGB::Navy); -// break; -// } -// -// case InputCommand::Blue: { -// setSolidColor(CRGB::Blue); -// break; -// } -// case InputCommand::RoyalBlue: { -// setSolidColor(CRGB::RoyalBlue); -// break; -// } -// case InputCommand::Purple: { -// setSolidColor(CRGB::Purple); -// break; -// } -// case InputCommand::Indigo: { -// setSolidColor(CRGB::Indigo); -// break; -// } -// case InputCommand::Magenta: { -// setSolidColor(CRGB::Magenta); -// break; -// } -// -// case InputCommand::White: { -// setSolidColor(CRGB::White); -// break; -// } -// case InputCommand::Pink: { -// setSolidColor(CRGB::Pink); -// break; -// } -// case InputCommand::LightPink: { -// setSolidColor(CRGB::LightPink); -// break; -// } -// case InputCommand::BabyBlue: { -// setSolidColor(CRGB::CornflowerBlue); -// break; -// } -// case InputCommand::LightBlue: { -// setSolidColor(CRGB::LightBlue); -// break; -// } -// } -//} + void loadSettings() { @@ -834,6 +657,26 @@ void setAutoplayDuration(uint8_t value) broadcastInt("autoplayDuration", autoplayDuration); } +void setAllLeafs(uint8_t value) +{ + allLeafs = value == 0 ? 0 : 1; + + EEPROM.write(8, allLeafs); + EEPROM.commit(); + + broadcastInt("allLeafs", allLeafs); +} + +void setSelectedLeaf(uint8_t value) +{ + selectedLeaf = value; + + EEPROM.write(9, selectedLeaf); + EEPROM.commit(); + + broadcastInt("selectedLeaf", selectedLeaf); +} + void setSolidColor(CRGB color) { setSolidColor(color.r, color.g, color.b); @@ -974,7 +817,8 @@ void strandTest() void showSolidColor() { - fill_solid(leds, NUM_LEDS, solidColor); + if (allLeafs == 0 && selectedLeaf > 0 && selectedLeaf <= LEAFCOUNT)fill_solid(leds + PIXELS_PER_LEAF * (selectedLeaf - 1), PIXELS_PER_LEAF, solidColor); + else fill_solid(leds, NUM_LEDS, solidColor); } // Patterns from FastLED example DemoReel100: https://github.com/FastLED/FastLED/blob/master/examples/DemoReel100/DemoReel100.ino @@ -982,7 +826,13 @@ void showSolidColor() void rainbow() { // FastLED's built-in rainbow generator - fill_rainbow( leds, NUM_LEDS, gHue, 255 / NUM_LEDS); + for (int i = 0; i < LEAFCOUNT; i++) + { + uint8_t myHue = (gHue + i * (255 / LEAFCOUNT)); + gHue = gHue > 255 ? gHue - 255 : gHue; + //Serial.printf("I:%d \tH:%d\n", i*PIXELS_PER_LEAF, myHue); + fill_solid(leds + i * PIXELS_PER_LEAF, PIXELS_PER_LEAF, CHSV(myHue, 255, 255)); + } } void rainbowWithGlitter() @@ -1000,23 +850,30 @@ void rainbowSolid() void confetti() { // random colored speckles that blink in and fade smoothly - fadeToBlackBy( leds, NUM_LEDS, 10); - int pos = random16(NUM_LEDS); + fadeToBlackBy(leds, NUM_LEDS, 3); + int pos = random16(LEAFCOUNT * 3); // leds[pos] += CHSV( gHue + random8(64), 200, 255); - leds[pos] += ColorFromPalette(palettes[currentPaletteIndex], gHue + random8(64)); + int val = gHue + random8(64); + for (int i = 0; i < (PIXELS_PER_LEAF / 3); i++) + { + + leds[i + pos * (PIXELS_PER_LEAF / 3)] += ColorFromPalette(palettes[currentPaletteIndex], val); + //Serial.printf("POS:%d\n", i + pos); + } } void sinelon() { // a colored dot sweeping back and forth, with fading trails - fadeToBlackBy( leds, NUM_LEDS, 20); + fadeToBlackBy(leds, NUM_LEDS, 20); int pos = beatsin16(speed, 0, NUM_LEDS); static int prevpos = 0; CRGB color = ColorFromPalette(palettes[currentPaletteIndex], gHue, 255); - if ( pos < prevpos ) { - fill_solid( leds + pos, (prevpos - pos) + 1, color); - } else { - fill_solid( leds + prevpos, (pos - prevpos) + 1, color); + if (pos < prevpos) { + fill_solid(leds + pos, (prevpos - pos) + 1, color); + } + else { + fill_solid(leds + prevpos, (pos - prevpos) + 1, color); } prevpos = pos; } @@ -1024,41 +881,54 @@ void sinelon() void bpm() { // colored stripes pulsing at a defined Beats-Per-Minute (BPM) - uint8_t beat = beatsin8( speed, 64, 255); + uint8_t beat = beatsin8(speed, 64, 255); CRGBPalette16 palette = palettes[currentPaletteIndex]; - for ( int i = 0; i < NUM_LEDS; i++) { - leds[i] = ColorFromPalette(palette, gHue + (i * 2), beat - gHue + (i * 10)); + for (int i = 0; i < LEAFCOUNT; i++) { + for (int i2 = 0; i2 < PIXELS_PER_LEAF; i2++)leds[i*PIXELS_PER_LEAF + i2] = ColorFromPalette(palette, gHue + (i * 2), beat - gHue + (i * 10)); } } +// BACKUP +/* +void bpm() +{ + // colored stripes pulsing at a defined Beats-Per-Minute (BPM) + uint8_t beat = beatsin8(speed, 64, 255); + CRGBPalette16 palette = palettes[currentPaletteIndex]; + for (int i = 0; i < NUM_LEDS; i++) { + leds[i] = ColorFromPalette(palette, gHue + (i * 2), beat - gHue + (i * 10)); + } +} +*/ + void juggle() { - static uint8_t numdots = 4; // Number of dots in use. - static uint8_t faderate = 2; // How long should the trails be. Very low value = longer trails. - static uint8_t hueinc = 255 / numdots - 1; // Incremental change in hue between each dot. - static uint8_t thishue = 0; // Starting hue. - static uint8_t curhue = 0; // The current hue + static uint8_t numdots = 4; // Number of dots in use. + static uint8_t faderate = 2; // How long should the trails be. Very low value = longer trails. + static uint8_t hueinc = 255 / numdots - 1; // Incremental change in hue between each dot. + static uint8_t thishue = 0; // Starting hue. + static uint8_t curhue = 0; // The current hue static uint8_t thissat = 255; // Saturation of the colour. static uint8_t thisbright = 255; // How bright should the LED/display be. - static uint8_t basebeat = 5; // Higher = faster movement. + static uint8_t basebeat = 5; // Higher = faster movement. - static uint8_t lastSecond = 99; // Static variable, means it's only defined once. This is our 'debounce' variable. + static uint8_t lastSecond = 99; // Static variable, means it's only defined once. This is our 'debounce' variable. uint8_t secondHand = (millis() / 1000) % 30; // IMPORTANT!!! Change '30' to a different value to change duration of the loop. if (lastSecond != secondHand) { // Debounce to make sure we're not repeating an assignment. lastSecond = secondHand; switch (secondHand) { - case 0: numdots = 1; basebeat = 20; hueinc = 16; faderate = 2; thishue = 0; break; // You can change values here, one at a time , or altogether. - case 10: numdots = 4; basebeat = 10; hueinc = 16; faderate = 8; thishue = 128; break; - case 20: numdots = 8; basebeat = 3; hueinc = 0; faderate = 8; thishue = random8(); break; // Only gets called once, and not continuously for the next several seconds. Therefore, no rainbows. - case 30: break; + case 0: numdots = 1; basebeat = 20; hueinc = 16; faderate = 2; thishue = 0; break; // You can change values here, one at a time , or altogether. + case 10: numdots = 4; basebeat = 10; hueinc = 16; faderate = 8; thishue = 128; break; + case 20: numdots = 8; basebeat = 3; hueinc = 0; faderate = 8; thishue = random8(); break; // Only gets called once, and not continuously for the next several seconds. Therefore, no rainbows. + case 30: break; } } // Several colored dots, weaving in and out of sync with each other curhue = thishue; // Reset the hue values. fadeToBlackBy(leds, NUM_LEDS, faderate); - for ( int i = 0; i < numdots; i++) { + for (int i = 0; i < numdots; i++) { //beat16 is a FastLED 3.1 function leds[beatsin16(basebeat + i + numdots, 0, NUM_LEDS)] += CHSV(gHue + curhue, thissat, thisbright); curhue += hueinc; @@ -1075,6 +945,55 @@ void water() heatMap(IceColors_p, false); } +// Pride2015 by Mark Kriegsman: https://gist.github.com/kriegsman/964de772d64c502760e5 +// This function draws rainbows with an ever-changing, +// widely-varying set of parameters. +void pride() +{ + static uint16_t sPseudotime = 0; + static uint16_t sLastMillis = 0; + static uint16_t sHue16 = 0; + + uint8_t sat8 = beatsin88(87, 220, 250); + uint8_t brightdepth = beatsin88(341, 96, 224); + uint16_t brightnessthetainc16 = beatsin88(203, (25 * 256), (40 * 256)); + uint8_t msmultiplier = beatsin88(147, 23, 60); + + uint16_t hue16 = sHue16;//gHue * 256; + uint16_t hueinc16 = beatsin88(113, 1, 3000); + + uint16_t ms = millis(); + uint16_t deltams = ms - sLastMillis; + sLastMillis = ms; + sPseudotime += deltams * msmultiplier; + sHue16 += deltams * beatsin88(400, 5, 9); + uint16_t brightnesstheta16 = sPseudotime; + + for (uint16_t i = 0; i < (LEAFCOUNT * 3); i++) { + hue16 += hueinc16; + uint8_t hue8 = hue16 / 256; + + brightnesstheta16 += brightnessthetainc16; + uint16_t b16 = sin16(brightnesstheta16) + 32768; + + uint16_t bri16 = (uint32_t)((uint32_t)b16 * (uint32_t)b16) / 65536; + uint8_t bri8 = (uint32_t)(((uint32_t)bri16) * brightdepth) / 65536; + bri8 += (255 - brightdepth); + + CRGB newcolor = CHSV(hue8, sat8, bri8); + + uint16_t pixelnumber = i; + pixelnumber = ((LEAFCOUNT * 3) - 1) - pixelnumber; + + for (int i2 = 0; i2 < (PIXELS_PER_LEAF / 3); i2++) + { + nblend(leds[pixelnumber*(PIXELS_PER_LEAF / 3) + i2], newcolor, 64); + } + } +} + +//#############BACKUP######################## +/* // Pride2015 by Mark Kriegsman: https://gist.github.com/kriegsman/964de772d64c502760e5 // This function draws rainbows with an ever-changing, // widely-varying set of parameters. @@ -1100,25 +1019,27 @@ void pride() uint16_t brightnesstheta16 = sPseudotime; for ( uint16_t i = 0 ; i < NUM_LEDS; i++) { - hue16 += hueinc16; - uint8_t hue8 = hue16 / 256; + hue16 += hueinc16; + uint8_t hue8 = hue16 / 256; - brightnesstheta16 += brightnessthetainc16; - uint16_t b16 = sin16( brightnesstheta16 ) + 32768; + brightnesstheta16 += brightnessthetainc16; + uint16_t b16 = sin16( brightnesstheta16 ) + 32768; - uint16_t bri16 = (uint32_t)((uint32_t)b16 * (uint32_t)b16) / 65536; - uint8_t bri8 = (uint32_t)(((uint32_t)bri16) * brightdepth) / 65536; - bri8 += (255 - brightdepth); + uint16_t bri16 = (uint32_t)((uint32_t)b16 * (uint32_t)b16) / 65536; + uint8_t bri8 = (uint32_t)(((uint32_t)bri16) * brightdepth) / 65536; + bri8 += (255 - brightdepth); - CRGB newcolor = CHSV( hue8, sat8, bri8); + CRGB newcolor = CHSV( hue8, sat8, bri8); - uint16_t pixelnumber = i; - pixelnumber = (NUM_LEDS - 1) - pixelnumber; + uint16_t pixelnumber = i; + pixelnumber = (NUM_LEDS - 1) - pixelnumber; - nblend( leds[pixelnumber], newcolor, 64); + nblend( leds[pixelnumber], newcolor, 64); } } +*/ + void radialPaletteShift() { for (uint16_t i = 0; i < NUM_LEDS; i++) { @@ -1141,23 +1062,23 @@ void heatMap(CRGBPalette16 palette, bool up) byte colorindex; // Step 1. Cool down every cell a little - for ( uint16_t i = 0; i < NUM_LEDS; i++) { - heat[i] = qsub8( heat[i], random8(0, ((cooling * 10) / NUM_LEDS) + 2)); + for (uint16_t i = 0; i < NUM_LEDS; i++) { + heat[i] = qsub8(heat[i], random8(0, ((cooling * 10) / NUM_LEDS) + 2)); } // Step 2. Heat from each cell drifts 'up' and diffuses a little - for ( uint16_t k = NUM_LEDS - 1; k >= 2; k--) { - heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2] ) / 3; + for (uint16_t k = NUM_LEDS - 1; k >= 2; k--) { + heat[k] = (heat[k - 1] + heat[k - 2] + heat[k - 2]) / 3; } // Step 3. Randomly ignite new 'sparks' of heat near the bottom - if ( random8() < sparking ) { + if (random8() < sparking) { int y = random8(7); - heat[y] = qadd8( heat[y], random8(160, 255) ); + heat[y] = qadd8(heat[y], random8(160, 255)); } // Step 4. Map from heat cells to LED colors - for ( uint16_t j = 0; j < NUM_LEDS; j++) { + for (uint16_t j = 0; j < NUM_LEDS; j++) { // Scale the heat value from 0-255 down to 0-240 // for best results with color palettes. colorindex = scale8(heat[j], 190); @@ -1173,10 +1094,10 @@ void heatMap(CRGBPalette16 palette, bool up) } } -void addGlitter( uint8_t chanceOfGlitter) +void addGlitter(uint8_t chanceOfGlitter) { - if ( random8() < chanceOfGlitter) { - leds[ random16(NUM_LEDS) ] += CRGB::White; + if (random8() < chanceOfGlitter) { + leds[random16(NUM_LEDS)] += CRGB::White; } } @@ -1188,58 +1109,59 @@ void addGlitter( uint8_t chanceOfGlitter) extern const TProgmemRGBGradientPalettePtr gGradientPalettes[]; extern const uint8_t gGradientPaletteCount; -uint8_t beatsaw8( accum88 beats_per_minute, uint8_t lowest = 0, uint8_t highest = 255, - uint32_t timebase = 0, uint8_t phase_offset = 0) +uint8_t beatsaw8(accum88 beats_per_minute, uint8_t lowest = 0, uint8_t highest = 255, + uint32_t timebase = 0, uint8_t phase_offset = 0) { - uint8_t beat = beat8( beats_per_minute, timebase); + uint8_t beat = beat8(beats_per_minute, timebase); uint8_t beatsaw = beat + phase_offset; uint8_t rangewidth = highest - lowest; - uint8_t scaledbeat = scale8( beatsaw, rangewidth); + uint8_t scaledbeat = scale8(beatsaw, rangewidth); uint8_t result = lowest + scaledbeat; return result; } void colorWaves() { - colorwaves( leds, NUM_LEDS, gCurrentPalette); + colorwaves(leds, LEAFCOUNT * 3, gCurrentPalette); } // ColorWavesWithPalettes by Mark Kriegsman: https://gist.github.com/kriegsman/8281905786e8b2632aeb // This function draws color waves with an ever-changing, // widely-varying set of parameters, using a color palette. -void colorwaves( CRGB* ledarray, uint16_t numleds, CRGBPalette16& palette) +void colorwaves(CRGB* ledarray, uint16_t numleds, CRGBPalette16& palette) { static uint16_t sPseudotime = 0; static uint16_t sLastMillis = 0; static uint16_t sHue16 = 0; // uint8_t sat8 = beatsin88( 87, 220, 250); - uint8_t brightdepth = beatsin88( 341, 96, 224); - uint16_t brightnessthetainc16 = beatsin88( 203, (25 * 256), (40 * 256)); + uint8_t brightdepth = beatsin88(341, 96, 224); + uint16_t brightnessthetainc16 = beatsin88(203, (25 * 256), (40 * 256)); uint8_t msmultiplier = beatsin88(147, 23, 60); uint16_t hue16 = sHue16;//gHue * 256; uint16_t hueinc16 = beatsin88(113, 300, 1500); uint16_t ms = millis(); - uint16_t deltams = ms - sLastMillis ; - sLastMillis = ms; + uint16_t deltams = ms - sLastMillis; + sLastMillis = ms; sPseudotime += deltams * msmultiplier; - sHue16 += deltams * beatsin88( 400, 5, 9); + sHue16 += deltams * beatsin88(400, 5, 9); uint16_t brightnesstheta16 = sPseudotime; - for ( uint16_t i = 0 ; i < numleds; i++) { + for (uint16_t i = 0; i < numleds; i++) { hue16 += hueinc16; uint8_t hue8 = hue16 / 256; uint16_t h16_128 = hue16 >> 7; - if ( h16_128 & 0x100) { + if (h16_128 & 0x100) { hue8 = 255 - (h16_128 >> 1); - } else { + } + else { hue8 = h16_128 >> 1; } - brightnesstheta16 += brightnessthetainc16; - uint16_t b16 = sin16( brightnesstheta16 ) + 32768; + brightnesstheta16 += brightnessthetainc16; + uint16_t b16 = sin16(brightnesstheta16) + 32768; uint16_t bri16 = (uint32_t)((uint32_t)b16 * (uint32_t)b16) / 65536; uint8_t bri8 = (uint32_t)(((uint32_t)bri16) * brightdepth) / 65536; @@ -1247,22 +1169,27 @@ void colorwaves( CRGB* ledarray, uint16_t numleds, CRGBPalette16& palette) uint8_t index = hue8; //index = triwave8( index); - index = scale8( index, 240); + index = scale8(index, 240); - CRGB newcolor = ColorFromPalette( palette, index, bri8); + CRGB newcolor = ColorFromPalette(palette, index, bri8); uint16_t pixelnumber = i; - pixelnumber = (numleds - 1) - pixelnumber; + //pixelnumber = (numleds - 1) - pixelnumber; + //nblend(ledarray[pixelnumber], newcolor, 128); - nblend( ledarray[pixelnumber], newcolor, 128); + pixelnumber = ((LEAFCOUNT * 3) - 1) - pixelnumber; + for (int i2 = 0; i2 < (PIXELS_PER_LEAF / 3); i2++) + { + nblend(leds[pixelnumber*(PIXELS_PER_LEAF / 3) + i2], newcolor, 128); + } } } // Alternate rendering function just scrolls the current palette // across the defined LED strip. -void palettetest( CRGB* ledarray, uint16_t numleds, const CRGBPalette16& gCurrentPalette) +void palettetest(CRGB* ledarray, uint16_t numleds, const CRGBPalette16& gCurrentPalette) { static uint8_t startindex = 0; startindex--; - fill_palette( ledarray, numleds, startindex, (256 / NUM_LEDS) + 1, gCurrentPalette, 255, LINEARBLEND); + fill_palette(ledarray, numleds, startindex, (256 / NUM_LEDS) + 1, gCurrentPalette, 255, LINEARBLEND); }