Compare commits
6 Commits
1.0
...
ultim8x8-c
Author | SHA1 | Date | |
---|---|---|---|
fc37d728ca | |||
623a03baa2 | |||
9b6f17b81c | |||
23dac4bb7c | |||
9025d0ed10 | |||
3a3bb2043c |
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"CurrentProjectSetting": "Visual Micro"
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"ExpandedNodes": [
|
|
||||||
"",
|
|
||||||
"\\data",
|
|
||||||
"\\data\\images"
|
|
||||||
],
|
|
||||||
"SelectedNode": "\\data\\index.htm",
|
|
||||||
"PreviewInSolutionExplorer": false
|
|
||||||
}
|
|
@ -1,113 +0,0 @@
|
|||||||
/*
|
|
||||||
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 <arduino.h>
|
|
||||||
#include <pins_arduino.h>
|
|
||||||
|
|
||||||
#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
|
|
BIN
.vs/slnx.sqlite
@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"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"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
11
Fields.h
@ -81,14 +81,6 @@ String getAutoplayDuration() {
|
|||||||
return String(autoplayDuration);
|
return String(autoplayDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
String getAllLeafs() {
|
|
||||||
return String(allLeafs);
|
|
||||||
}
|
|
||||||
|
|
||||||
String getSelectedLeaf() {
|
|
||||||
return String(selectedLeaf);
|
|
||||||
}
|
|
||||||
|
|
||||||
String getSolidColor() {
|
String getSolidColor() {
|
||||||
return String(solidColor.r) + "," + String(solidColor.g) + "," + String(solidColor.b);
|
return String(solidColor.r) + "," + String(solidColor.g) + "," + String(solidColor.b);
|
||||||
}
|
}
|
||||||
@ -122,9 +114,6 @@ FieldList fields = {
|
|||||||
{ "autoplay", "Autoplay", SectionFieldType },
|
{ "autoplay", "Autoplay", SectionFieldType },
|
||||||
{ "autoplay", "Autoplay", BooleanFieldType, 0, 1, getAutoplay },
|
{ "autoplay", "Autoplay", BooleanFieldType, 0, 1, getAutoplay },
|
||||||
{ "autoplayDuration", "Autoplay Duration", NumberFieldType, 0, 255, getAutoplayDuration },
|
{ "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", "Solid Color", SectionFieldType },
|
||||||
{ "solidColor", "Color", ColorFieldType, 0, 255, getSolidColor },
|
{ "solidColor", "Color", ColorFieldType, 0, 255, getSolidColor },
|
||||||
{ "fire", "Fire & Water", SectionFieldType },
|
{ "fire", "Fire & Water", SectionFieldType },
|
||||||
|
@ -14,8 +14,7 @@ DEFINE_GRADIENT_PALETTE(ib_jul01_gp) {
|
|||||||
0, 194, 1, 1,
|
0, 194, 1, 1,
|
||||||
94, 1, 29, 18,
|
94, 1, 29, 18,
|
||||||
132, 57,131, 28,
|
132, 57,131, 28,
|
||||||
255, 113, 1, 1
|
255, 113, 1, 1};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "es_vintage_57_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/vintage/tn/es_vintage_57.png.index.html
|
||||||
@ -27,8 +26,7 @@ DEFINE_GRADIENT_PALETTE(es_vintage_57_gp) {
|
|||||||
53, 18, 1, 0,
|
53, 18, 1, 0,
|
||||||
104, 69, 29, 1,
|
104, 69, 29, 1,
|
||||||
153, 167,135, 10,
|
153, 167,135, 10,
|
||||||
255, 46, 56, 4
|
255, 46, 56, 4};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "es_vintage_01_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/vintage/tn/es_vintage_01.png.index.html
|
||||||
@ -43,8 +41,7 @@ DEFINE_GRADIENT_PALETTE(es_vintage_01_gp) {
|
|||||||
127, 67, 9, 4,
|
127, 67, 9, 4,
|
||||||
153, 16, 0, 1,
|
153, 16, 0, 1,
|
||||||
229, 4, 1, 1,
|
229, 4, 1, 1,
|
||||||
255, 4, 1, 1
|
255, 4, 1, 1};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "es_rivendell_15_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/rivendell/tn/es_rivendell_15.png.index.html
|
||||||
@ -56,8 +53,7 @@ DEFINE_GRADIENT_PALETTE(es_rivendell_15_gp) {
|
|||||||
101, 16, 36, 14,
|
101, 16, 36, 14,
|
||||||
165, 56, 68, 30,
|
165, 56, 68, 30,
|
||||||
242, 150,156, 99,
|
242, 150,156, 99,
|
||||||
255, 150, 156, 99
|
255, 150,156, 99};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "rgi_15_gp", originally from
|
// Gradient palette "rgi_15_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/ds/rgi/tn/rgi_15.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/ds/rgi/tn/rgi_15.png.index.html
|
||||||
@ -73,8 +69,7 @@ DEFINE_GRADIENT_PALETTE(rgi_15_gp) {
|
|||||||
159, 39, 6, 33,
|
159, 39, 6, 33,
|
||||||
191, 112, 13, 32,
|
191, 112, 13, 32,
|
||||||
223, 56, 9, 35,
|
223, 56, 9, 35,
|
||||||
255, 22, 6, 38
|
255, 22, 6, 38};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "retro2_16_gp", originally from
|
// Gradient palette "retro2_16_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/ma/retro2/tn/retro2_16.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/ma/retro2/tn/retro2_16.png.index.html
|
||||||
@ -83,8 +78,7 @@ DEFINE_GRADIENT_PALETTE(rgi_15_gp) {
|
|||||||
|
|
||||||
DEFINE_GRADIENT_PALETTE( retro2_16_gp ) {
|
DEFINE_GRADIENT_PALETTE( retro2_16_gp ) {
|
||||||
0, 188,135, 1,
|
0, 188,135, 1,
|
||||||
255, 46, 7, 1
|
255, 46, 7, 1};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "Analogous_1_gp", originally from
|
// Gradient palette "Analogous_1_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/red/tn/Analogous_1.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/red/tn/Analogous_1.png.index.html
|
||||||
@ -96,8 +90,7 @@ DEFINE_GRADIENT_PALETTE(Analogous_1_gp) {
|
|||||||
63, 23, 0,255,
|
63, 23, 0,255,
|
||||||
127, 67, 0,255,
|
127, 67, 0,255,
|
||||||
191, 142, 0, 45,
|
191, 142, 0, 45,
|
||||||
255, 255, 0, 0
|
255, 255, 0, 0};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "es_pinksplash_08_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/pink_splash/tn/es_pinksplash_08.png.index.html
|
||||||
@ -109,8 +102,7 @@ DEFINE_GRADIENT_PALETTE(es_pinksplash_08_gp) {
|
|||||||
127, 197, 1, 22,
|
127, 197, 1, 22,
|
||||||
175, 210,157,172,
|
175, 210,157,172,
|
||||||
221, 157, 3,112,
|
221, 157, 3,112,
|
||||||
255, 157, 3, 112
|
255, 157, 3,112};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "es_pinksplash_07_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/pink_splash/tn/es_pinksplash_07.png.index.html
|
||||||
@ -124,8 +116,7 @@ DEFINE_GRADIENT_PALETTE(es_pinksplash_07_gp) {
|
|||||||
127, 249, 81,252,
|
127, 249, 81,252,
|
||||||
153, 255, 11,235,
|
153, 255, 11,235,
|
||||||
193, 244, 5, 68,
|
193, 244, 5, 68,
|
||||||
255, 232, 1, 5
|
255, 232, 1, 5};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "Coral_reef_gp", originally from
|
// Gradient palette "Coral_reef_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/other/tn/Coral_reef.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/other/tn/Coral_reef.png.index.html
|
||||||
@ -138,8 +129,7 @@ DEFINE_GRADIENT_PALETTE(Coral_reef_gp) {
|
|||||||
96, 1,111,120,
|
96, 1,111,120,
|
||||||
96, 43,127,162,
|
96, 43,127,162,
|
||||||
139, 10, 73,111,
|
139, 10, 73,111,
|
||||||
255, 1, 34, 71
|
255, 1, 34, 71};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "es_ocean_breeze_068_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/ocean_breeze/tn/es_ocean_breeze_068.png.index.html
|
||||||
@ -152,8 +142,7 @@ DEFINE_GRADIENT_PALETTE(es_ocean_breeze_068_gp) {
|
|||||||
101, 1, 68, 84,
|
101, 1, 68, 84,
|
||||||
104, 35,142,168,
|
104, 35,142,168,
|
||||||
178, 0, 63,117,
|
178, 0, 63,117,
|
||||||
255, 1, 10, 10
|
255, 1, 10, 10};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "es_ocean_breeze_036_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/ocean_breeze/tn/es_ocean_breeze_036.png.index.html
|
||||||
@ -164,8 +153,7 @@ DEFINE_GRADIENT_PALETTE(es_ocean_breeze_036_gp) {
|
|||||||
0, 1, 6, 7,
|
0, 1, 6, 7,
|
||||||
89, 1, 99,111,
|
89, 1, 99,111,
|
||||||
153, 144,209,255,
|
153, 144,209,255,
|
||||||
255, 0, 73, 82
|
255, 0, 73, 82};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "departure_gp", originally from
|
// Gradient palette "departure_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/mjf/tn/departure.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/mjf/tn/departure.png.index.html
|
||||||
@ -184,8 +172,7 @@ DEFINE_GRADIENT_PALETTE(departure_gp) {
|
|||||||
170, 0,255, 0,
|
170, 0,255, 0,
|
||||||
191, 0,136, 0,
|
191, 0,136, 0,
|
||||||
212, 0, 55, 0,
|
212, 0, 55, 0,
|
||||||
255, 0, 55, 0
|
255, 0, 55, 0};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "es_landscape_64_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/landscape/tn/es_landscape_64.png.index.html
|
||||||
@ -201,8 +188,7 @@ DEFINE_GRADIENT_PALETTE(es_landscape_64_gp) {
|
|||||||
130, 188,209,247,
|
130, 188,209,247,
|
||||||
153, 144,182,205,
|
153, 144,182,205,
|
||||||
204, 59,117,250,
|
204, 59,117,250,
|
||||||
255, 1, 37, 192
|
255, 1, 37,192};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "es_landscape_33_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/landscape/tn/es_landscape_33.png.index.html
|
||||||
@ -215,8 +201,7 @@ DEFINE_GRADIENT_PALETTE(es_landscape_33_gp) {
|
|||||||
38, 161, 55, 1,
|
38, 161, 55, 1,
|
||||||
63, 229,144, 1,
|
63, 229,144, 1,
|
||||||
66, 39,142, 74,
|
66, 39,142, 74,
|
||||||
255, 1, 4, 1
|
255, 1, 4, 1};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "rainbowsherbet_gp", originally from
|
// Gradient palette "rainbowsherbet_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/ma/icecream/tn/rainbowsherbet.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/ma/icecream/tn/rainbowsherbet.png.index.html
|
||||||
@ -230,8 +215,7 @@ DEFINE_GRADIENT_PALETTE(rainbowsherbet_gp) {
|
|||||||
127, 255, 82,103,
|
127, 255, 82,103,
|
||||||
170, 255,255,242,
|
170, 255,255,242,
|
||||||
209, 42,255, 22,
|
209, 42,255, 22,
|
||||||
255, 87, 255, 65
|
255, 87,255, 65};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "gr65_hult_gp", originally from
|
// Gradient palette "gr65_hult_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/hult/tn/gr65_hult.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/hult/tn/gr65_hult.png.index.html
|
||||||
@ -244,8 +228,7 @@ DEFINE_GRADIENT_PALETTE(gr65_hult_gp) {
|
|||||||
89, 220, 29,226,
|
89, 220, 29,226,
|
||||||
160, 7, 82,178,
|
160, 7, 82,178,
|
||||||
216, 1,124,109,
|
216, 1,124,109,
|
||||||
255, 1, 124, 109
|
255, 1,124,109};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "gr64_hult_gp", originally from
|
// Gradient palette "gr64_hult_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/hult/tn/gr64_hult.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/hult/tn/gr64_hult.png.index.html
|
||||||
@ -260,8 +243,7 @@ DEFINE_GRADIENT_PALETTE(gr64_hult_gp) {
|
|||||||
150, 52, 65, 1,
|
150, 52, 65, 1,
|
||||||
201, 1, 86, 72,
|
201, 1, 86, 72,
|
||||||
239, 0, 55, 45,
|
239, 0, 55, 45,
|
||||||
255, 0, 55, 45
|
255, 0, 55, 45};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "GMT_drywet_gp", originally from
|
// Gradient palette "GMT_drywet_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/gmt/tn/GMT_drywet.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/gmt/tn/GMT_drywet.png.index.html
|
||||||
@ -275,8 +257,7 @@ DEFINE_GRADIENT_PALETTE(GMT_drywet_gp) {
|
|||||||
127, 3,219,207,
|
127, 3,219,207,
|
||||||
170, 1, 48,214,
|
170, 1, 48,214,
|
||||||
212, 1, 1,111,
|
212, 1, 1,111,
|
||||||
255, 1, 7, 33
|
255, 1, 7, 33};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "ib15_gp", originally from
|
// Gradient palette "ib15_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/ing/general/tn/ib15.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/ing/general/tn/ib15.png.index.html
|
||||||
@ -289,8 +270,7 @@ DEFINE_GRADIENT_PALETTE(ib15_gp) {
|
|||||||
89, 208, 85, 33,
|
89, 208, 85, 33,
|
||||||
107, 255, 29, 11,
|
107, 255, 29, 11,
|
||||||
141, 137, 31, 39,
|
141, 137, 31, 39,
|
||||||
255, 59, 33, 89
|
255, 59, 33, 89};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "Fuschia_7_gp", originally from
|
// Gradient palette "Fuschia_7_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/ds/fuschia/tn/Fuschia-7.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/ds/fuschia/tn/Fuschia-7.png.index.html
|
||||||
@ -302,8 +282,7 @@ DEFINE_GRADIENT_PALETTE(Fuschia_7_gp) {
|
|||||||
63, 100, 4,103,
|
63, 100, 4,103,
|
||||||
127, 188, 5, 66,
|
127, 188, 5, 66,
|
||||||
191, 161, 11,115,
|
191, 161, 11,115,
|
||||||
255, 135, 20, 182
|
255, 135, 20,182};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "es_emerald_dragon_08_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/emerald_dragon/tn/es_emerald_dragon_08.png.index.html
|
||||||
@ -314,8 +293,7 @@ DEFINE_GRADIENT_PALETTE(es_emerald_dragon_08_gp) {
|
|||||||
0, 97,255, 1,
|
0, 97,255, 1,
|
||||||
101, 47,133, 1,
|
101, 47,133, 1,
|
||||||
178, 13, 43, 1,
|
178, 13, 43, 1,
|
||||||
255, 2, 10, 1
|
255, 2, 10, 1};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "lava_gp", originally from
|
// Gradient palette "lava_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/neota/elem/tn/lava.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/neota/elem/tn/lava.png.index.html
|
||||||
@ -335,8 +313,7 @@ DEFINE_GRADIENT_PALETTE(lava_gp) {
|
|||||||
218, 255,203, 4,
|
218, 255,203, 4,
|
||||||
234, 255,255, 4,
|
234, 255,255, 4,
|
||||||
244, 255,255, 71,
|
244, 255,255, 71,
|
||||||
255, 255, 255, 255
|
255, 255,255,255};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "fire_gp", originally from
|
// Gradient palette "fire_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/neota/elem/tn/fire.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/neota/elem/tn/fire.png.index.html
|
||||||
@ -350,8 +327,7 @@ DEFINE_GRADIENT_PALETTE(fire_gp) {
|
|||||||
197, 220,105, 5,
|
197, 220,105, 5,
|
||||||
240, 252,255, 31,
|
240, 252,255, 31,
|
||||||
250, 252,255,111,
|
250, 252,255,111,
|
||||||
255, 255, 255, 255
|
255, 255,255,255};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "Colorfull_gp", originally from
|
// Gradient palette "Colorfull_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Colorfull.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Colorfull.png.index.html
|
||||||
@ -369,8 +345,7 @@ DEFINE_GRADIENT_PALETTE(Colorfull_gp) {
|
|||||||
116, 192,117, 98,
|
116, 192,117, 98,
|
||||||
124, 255,255,137,
|
124, 255,255,137,
|
||||||
168, 100,180,155,
|
168, 100,180,155,
|
||||||
255, 22, 121, 174
|
255, 22,121,174};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "Magenta_Evening_gp", originally from
|
// Gradient palette "Magenta_Evening_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Magenta_Evening.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Magenta_Evening.png.index.html
|
||||||
@ -384,8 +359,7 @@ DEFINE_GRADIENT_PALETTE(Magenta_Evening_gp) {
|
|||||||
70, 232, 1, 66,
|
70, 232, 1, 66,
|
||||||
76, 252, 1, 69,
|
76, 252, 1, 69,
|
||||||
108, 123, 2, 51,
|
108, 123, 2, 51,
|
||||||
255, 46, 9, 35
|
255, 46, 9, 35};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "Pink_Purple_gp", originally from
|
// Gradient palette "Pink_Purple_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Pink_Purple.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Pink_Purple.png.index.html
|
||||||
@ -403,8 +377,7 @@ DEFINE_GRADIENT_PALETTE(Pink_Purple_gp) {
|
|||||||
122, 159,149,221,
|
122, 159,149,221,
|
||||||
149, 113, 78,188,
|
149, 113, 78,188,
|
||||||
183, 128, 57,155,
|
183, 128, 57,155,
|
||||||
255, 146, 40, 123
|
255, 146, 40,123};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "Sunset_Real_gp", originally from
|
// Gradient palette "Sunset_Real_gp", originally from
|
||||||
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Sunset_Real.png.index.html
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/atmospheric/tn/Sunset_Real.png.index.html
|
||||||
@ -418,8 +391,7 @@ DEFINE_GRADIENT_PALETTE(Sunset_Real_gp) {
|
|||||||
85, 167, 22, 18,
|
85, 167, 22, 18,
|
||||||
135, 100, 0,103,
|
135, 100, 0,103,
|
||||||
198, 16, 0,130,
|
198, 16, 0,130,
|
||||||
255, 0, 0, 160
|
255, 0, 0,160};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "es_autumn_19_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/es/autumn/tn/es_autumn_19.png.index.html
|
||||||
@ -439,8 +411,7 @@ DEFINE_GRADIENT_PALETTE(es_autumn_19_gp) {
|
|||||||
163, 113, 13, 1,
|
163, 113, 13, 1,
|
||||||
204, 55, 3, 1,
|
204, 55, 3, 1,
|
||||||
249, 17, 1, 1,
|
249, 17, 1, 1,
|
||||||
255, 17, 1, 1
|
255, 17, 1, 1};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "BlacK_Blue_Magenta_White_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/basic/tn/BlacK_Blue_Magenta_White.png.index.html
|
||||||
@ -454,8 +425,7 @@ DEFINE_GRADIENT_PALETTE(BlacK_Blue_Magenta_White_gp) {
|
|||||||
127, 42, 0,255,
|
127, 42, 0,255,
|
||||||
170, 255, 0,255,
|
170, 255, 0,255,
|
||||||
212, 255, 55,255,
|
212, 255, 55,255,
|
||||||
255, 255, 255, 255
|
255, 255,255,255};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "BlacK_Magenta_Red_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/basic/tn/BlacK_Magenta_Red.png.index.html
|
||||||
@ -467,8 +437,7 @@ DEFINE_GRADIENT_PALETTE(BlacK_Magenta_Red_gp) {
|
|||||||
63, 42, 0, 45,
|
63, 42, 0, 45,
|
||||||
127, 255, 0,255,
|
127, 255, 0,255,
|
||||||
191, 255, 0, 45,
|
191, 255, 0, 45,
|
||||||
255, 255, 0, 0
|
255, 255, 0, 0};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "BlacK_Red_Magenta_Yellow_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/basic/tn/BlacK_Red_Magenta_Yellow.png.index.html
|
||||||
@ -482,8 +451,7 @@ DEFINE_GRADIENT_PALETTE(BlacK_Red_Magenta_Yellow_gp) {
|
|||||||
127, 255, 0, 45,
|
127, 255, 0, 45,
|
||||||
170, 255, 0,255,
|
170, 255, 0,255,
|
||||||
212, 255, 55, 45,
|
212, 255, 55, 45,
|
||||||
255, 255, 255, 0
|
255, 255,255, 0};
|
||||||
};
|
|
||||||
|
|
||||||
// Gradient palette "Blue_Cyan_Yellow_gp", originally from
|
// 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
|
// http://soliton.vm.bytemark.co.uk/pub/cpt-city/nd/basic/tn/Blue_Cyan_Yellow.png.index.html
|
||||||
@ -495,8 +463,7 @@ DEFINE_GRADIENT_PALETTE(Blue_Cyan_Yellow_gp) {
|
|||||||
63, 0, 55,255,
|
63, 0, 55,255,
|
||||||
127, 0,255,255,
|
127, 0,255,255,
|
||||||
191, 42,255, 45,
|
191, 42,255, 45,
|
||||||
255, 255, 255, 0
|
255, 255,255, 0};
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Single array of defined cpt-city color palettes.
|
// Single array of defined cpt-city color palettes.
|
||||||
|
165
Map.h
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
// original 8x8x8 map (0-7), caused a seam between panels
|
||||||
|
// const uint8_t coordsX[NUM_LEDS] = { 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7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8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8, 8, 7, 6, 5, 4, 3, 2, 1, 1, 2, 3, 4, 5, 6, 7, 8 };
|
||||||
|
|
||||||
|
// vertically oriented z map
|
||||||
|
const uint8_t coordsVZ[NUM_LEDS] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 5, 4, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 11, 10, 9, 8, 7, 6, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 13, 12, 11, 10, 9, 8, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 15, 14, 13, 12, 11, 10, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 17, 16, 15, 14, 13, 12, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 19, 18, 17, 16, 15, 14, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 21, 20, 19, 18, 17, 16, 15, 15, 16, 17, 18, 19, 20, 21, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 14, 15, 16, 17, 18, 19, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 12, 13, 14, 15, 16, 17, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 10, 11, 12, 13, 14, 15, 16, 15, 14, 13, 12, 11, 10, 9, 8, 22, 21, 20, 19, 18, 17, 16, 15, 14, 15, 16, 17, 18, 19, 20, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 13, 14, 15, 16, 17, 18, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 11, 12, 13, 14, 15, 16, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 9, 10, 11, 12, 13, 14, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 7, 8, 9, 10, 11, 12, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 5, 6, 7, 8, 9, 10, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 10, 9, 8, 7, 6, 5, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 12, 11, 10, 9, 8, 7, 6, 7, 8, 9, 10, 11, 12, 13, 14 };
|
||||||
|
const uint8_t maxVZ = 22;
|
||||||
|
const uint8_t verticalHues = 255 / maxVZ;
|
||||||
|
|
||||||
|
void paletteFall() {
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
leds[i] = ColorFromPalette(palettes[currentPaletteIndex], beat8(speed) + (coordsVZ[i] * verticalHues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void paletteRise() {
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
leds[i] = ColorFromPalette(palettes[currentPaletteIndex], beat8(speed) - (coordsVZ[i] * verticalHues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void gradientPaletteFall() {
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
leds[i] = ColorFromPalette(gCurrentPalette, beat8(speed) + (coordsVZ[i] * verticalHues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void gradientPaletteRise() {
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
leds[i] = ColorFromPalette(gCurrentPalette, beat8(speed) - (coordsVZ[i] * verticalHues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cubeXGradientPalette() {
|
||||||
|
uint8_t hues = 8;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
uint8_t x = coordsX[i];
|
||||||
|
|
||||||
|
leds[i] = ColorFromPalette(gCurrentPalette, beat8(speed) - (x * hues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cubeYGradientPalette() {
|
||||||
|
uint8_t hues = 8;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
uint8_t y = coordsY[i];
|
||||||
|
|
||||||
|
leds[i] = ColorFromPalette(gCurrentPalette, beat8(speed) - (y * hues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cubeZGradientPalette() {
|
||||||
|
uint8_t hues = 8;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
uint8_t z = coordsZ[i];
|
||||||
|
|
||||||
|
leds[i] = ColorFromPalette(gCurrentPalette, beat8(speed) - (z * hues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cubeXYGradientPalette() {
|
||||||
|
uint8_t hues = 8;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
uint8_t x = coordsX[i];
|
||||||
|
uint8_t y = coordsY[i];
|
||||||
|
|
||||||
|
leds[i] = ColorFromPalette(gCurrentPalette, beat8(speed) - ((x + y) * hues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cubeXZGradientPalette() {
|
||||||
|
uint8_t hues = 8;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
uint8_t x = coordsX[i];
|
||||||
|
uint8_t z = coordsZ[i];
|
||||||
|
|
||||||
|
leds[i] = ColorFromPalette(gCurrentPalette, beat8(speed) - ((x + z) * hues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cubeYZGradientPalette() {
|
||||||
|
uint8_t hues = 8;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
uint8_t y = coordsY[i];
|
||||||
|
uint8_t z = coordsZ[i];
|
||||||
|
|
||||||
|
leds[i] = ColorFromPalette(gCurrentPalette, beat8(speed) - ((y + z) * hues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cubeXPalette() {
|
||||||
|
uint8_t hues = 8;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
uint8_t x = coordsX[i];
|
||||||
|
|
||||||
|
leds[i] = ColorFromPalette(palettes[currentPaletteIndex], beat8(speed) - (x * hues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cubeYPalette() {
|
||||||
|
uint8_t hues = 8;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
uint8_t y = coordsY[i];
|
||||||
|
|
||||||
|
leds[i] = ColorFromPalette(palettes[currentPaletteIndex], beat8(speed) - (y * hues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cubeZPalette() {
|
||||||
|
uint8_t hues = 8;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
uint8_t z = coordsZ[i];
|
||||||
|
|
||||||
|
leds[i] = ColorFromPalette(palettes[currentPaletteIndex], beat8(speed) - (z * hues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cubeXYPalette() {
|
||||||
|
uint8_t hues = 8;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
uint8_t x = coordsX[i];
|
||||||
|
uint8_t y = coordsY[i];
|
||||||
|
|
||||||
|
leds[i] = ColorFromPalette(palettes[currentPaletteIndex], beat8(speed) - ((x + y) * hues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cubeXZPalette() {
|
||||||
|
uint8_t hues = 8;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
uint8_t x = coordsX[i];
|
||||||
|
uint8_t z = coordsZ[i];
|
||||||
|
|
||||||
|
leds[i] = ColorFromPalette(palettes[currentPaletteIndex], beat8(speed) - ((x + z) * hues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cubeYZPalette() {
|
||||||
|
uint8_t hues = 8;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
uint8_t y = coordsY[i];
|
||||||
|
uint8_t z = coordsZ[i];
|
||||||
|
|
||||||
|
leds[i] = ColorFromPalette(palettes[currentPaletteIndex], beat8(speed) - ((y + z) * hues));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
212
Noise.h
Normal file
@ -0,0 +1,212 @@
|
|||||||
|
/*
|
||||||
|
ESP8266 + FastLED + IR Remote: https://github.com/jasoncoon/esp8266-fastled-webserver
|
||||||
|
Copyright (C) 2015-2016 Jason Coon
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// The 16 bit version of our coordinates
|
||||||
|
uint16_t noisex;
|
||||||
|
uint16_t noisey;
|
||||||
|
uint16_t noisez;
|
||||||
|
|
||||||
|
// We're using the x/y dimensions to map to the x/y pixels on the matrix. We'll
|
||||||
|
// use the z-axis for "time". speed determines how fast time moves forward. Try
|
||||||
|
// 1 for a very slow moving effect, or 60 for something that ends up looking like
|
||||||
|
// water.
|
||||||
|
int8_t noisespeedx = 0;
|
||||||
|
int8_t noisespeedy = 1;
|
||||||
|
int8_t noisespeedz = 0;
|
||||||
|
|
||||||
|
// Scale determines how far apart the pixels in our noise matrix are. Try
|
||||||
|
// changing these values around to see how it affects the motion of the display. The
|
||||||
|
// higher the value of scale, the more "zoomed out" the noise will be. A value
|
||||||
|
// of 1 will be so zoomed in, you'll mostly see solid colors.
|
||||||
|
uint16_t noisescale = 1; // scale is set dynamically once we've started up
|
||||||
|
|
||||||
|
uint8_t colorLoop = 0;
|
||||||
|
|
||||||
|
CRGBPalette16 blackAndWhiteStripedPalette;
|
||||||
|
|
||||||
|
// This function sets up a palette of black and white stripes,
|
||||||
|
// using code. Since the palette is effectively an array of
|
||||||
|
// sixteen CRGB colors, the various fill_* functions can be used
|
||||||
|
// to set them up.
|
||||||
|
void SetupBlackAndWhiteStripedPalette()
|
||||||
|
{
|
||||||
|
// 'black out' all 16 palette entries...
|
||||||
|
fill_solid( blackAndWhiteStripedPalette, 16, CRGB::Black);
|
||||||
|
// and set every fourth one to white.
|
||||||
|
blackAndWhiteStripedPalette[0] = CRGB::White;
|
||||||
|
blackAndWhiteStripedPalette[4] = CRGB::White;
|
||||||
|
blackAndWhiteStripedPalette[8] = CRGB::White;
|
||||||
|
blackAndWhiteStripedPalette[12] = CRGB::White;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
CRGBPalette16 blackAndBlueStripedPalette;
|
||||||
|
|
||||||
|
// This function sets up a palette of black and blue stripes,
|
||||||
|
// using code. Since the palette is effectively an array of
|
||||||
|
// sixteen CRGB colors, the various fill_* functions can be used
|
||||||
|
// to set them up.
|
||||||
|
void SetupBlackAndBlueStripedPalette()
|
||||||
|
{
|
||||||
|
// 'black out' all 16 palette entries...
|
||||||
|
fill_solid( blackAndBlueStripedPalette, 16, CRGB::Black);
|
||||||
|
|
||||||
|
for(uint8_t i = 0; i < 6; i++) {
|
||||||
|
blackAndBlueStripedPalette[i] = CRGB::Blue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// There are several different palettes of colors demonstrated here.
|
||||||
|
//
|
||||||
|
// FastLED provides several 'preset' palettes: RainbowColors_p, RainbowStripeColors_p,
|
||||||
|
// OceanColors_p, CloudColors_p, LavaColors_p, ForestColors_p, and PartyColors_p.
|
||||||
|
//
|
||||||
|
// Additionally, you can manually define your own color palettes, or you can write
|
||||||
|
// code that creates color palettes on the fly.
|
||||||
|
|
||||||
|
void drawNoise3d(CRGBPalette16 palette, uint8_t hueReduce = 0)
|
||||||
|
{
|
||||||
|
for(uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
|
uint8_t x = coordsX[i];
|
||||||
|
uint8_t y = coordsY[i];
|
||||||
|
uint8_t z = coordsZ[i];
|
||||||
|
|
||||||
|
int xoffset = noisescale * x;
|
||||||
|
int yoffset = noisescale * y;
|
||||||
|
int zoffset = noisescale * z;
|
||||||
|
|
||||||
|
uint8_t data = inoise8(x + xoffset + noisex, y + yoffset + noisey, z + zoffset + noisez);
|
||||||
|
|
||||||
|
// The range of the inoise8 function is roughly 16-238.
|
||||||
|
// These two operations expand those values out to roughly 0..255
|
||||||
|
// You can comment them out if you want the raw noise data.
|
||||||
|
data = qsub8(data, 16);
|
||||||
|
data = qadd8(data, scale8(data, 39));
|
||||||
|
|
||||||
|
if(hueReduce > 0 && data >= hueReduce)
|
||||||
|
data -= hueReduce;
|
||||||
|
|
||||||
|
leds[i] = ColorFromPalette(palette, data, 255, LINEARBLEND);
|
||||||
|
}
|
||||||
|
|
||||||
|
noisex += noisespeedx;
|
||||||
|
noisey += noisespeedy;
|
||||||
|
noisez += noisespeedz;
|
||||||
|
}
|
||||||
|
|
||||||
|
void rainbowNoise3d() {
|
||||||
|
noisespeedx = -1;
|
||||||
|
noisespeedy = -1;
|
||||||
|
noisespeedz = 0;
|
||||||
|
noisescale = 24;
|
||||||
|
colorLoop = 0;
|
||||||
|
drawNoise3d(RainbowColors_p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void rainbowStripeNoise3d() {
|
||||||
|
noisespeedx = -1;
|
||||||
|
noisespeedy = -1;
|
||||||
|
noisespeedz = -1;
|
||||||
|
noisescale = 24;
|
||||||
|
colorLoop = 0;
|
||||||
|
drawNoise3d(RainbowStripeColors_p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void partyNoise3d() {
|
||||||
|
noisespeedx = -9;
|
||||||
|
noisespeedy = 0;
|
||||||
|
noisespeedz = 0;
|
||||||
|
noisescale = 32;
|
||||||
|
colorLoop = 0;
|
||||||
|
drawNoise3d(PartyColors_p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void forestNoise3d() {
|
||||||
|
noisespeedx = -9;
|
||||||
|
noisespeedy = 0;
|
||||||
|
noisespeedz = 0;
|
||||||
|
noisescale = 32;
|
||||||
|
colorLoop = 0;
|
||||||
|
drawNoise3d(ForestColors_p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cloudNoise3d() {
|
||||||
|
noisespeedx = -2;
|
||||||
|
noisespeedy = 0;
|
||||||
|
noisespeedz = 0;
|
||||||
|
noisescale = 24;
|
||||||
|
colorLoop = 0;
|
||||||
|
drawNoise3d(CloudColors_p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void fireNoise3d() {
|
||||||
|
noisespeedx = 16;
|
||||||
|
noisespeedy = 16;
|
||||||
|
noisespeedz = 16;
|
||||||
|
noisescale = 64;
|
||||||
|
colorLoop = 0;
|
||||||
|
drawNoise3d(HeatColors_p, 60);
|
||||||
|
}
|
||||||
|
|
||||||
|
void fireNoise23d() {
|
||||||
|
noisespeedx = -3;
|
||||||
|
noisespeedy = -3;
|
||||||
|
noisespeedz = -3;
|
||||||
|
noisescale = 32;
|
||||||
|
colorLoop = 0;
|
||||||
|
drawNoise3d(HeatColors_p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void lavaNoise3d() {
|
||||||
|
noisespeedx = -4;
|
||||||
|
noisespeedy = -4;
|
||||||
|
noisespeedz = -4;
|
||||||
|
noisescale = 32;
|
||||||
|
colorLoop = 0;
|
||||||
|
drawNoise3d(LavaColors_p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void oceanNoise3d() {
|
||||||
|
noisespeedx = -2;
|
||||||
|
noisespeedy = 0;
|
||||||
|
noisespeedz = 4;
|
||||||
|
noisescale = 24;
|
||||||
|
colorLoop = 0;
|
||||||
|
drawNoise3d(OceanColors_p);
|
||||||
|
}
|
||||||
|
|
||||||
|
void blackAndWhiteNoise3d() {
|
||||||
|
SetupBlackAndWhiteStripedPalette();
|
||||||
|
noisespeedx = -12;
|
||||||
|
noisespeedy = 0;
|
||||||
|
noisespeedz = 0;
|
||||||
|
noisescale = 24;
|
||||||
|
colorLoop = 0;
|
||||||
|
drawNoise3d(blackAndWhiteStripedPalette);
|
||||||
|
}
|
||||||
|
|
||||||
|
void blackAndBlueNoise3d() {
|
||||||
|
SetupBlackAndBlueStripedPalette();
|
||||||
|
noisespeedx = -4;
|
||||||
|
noisespeedy = -4;
|
||||||
|
noisespeedz = -4;
|
||||||
|
noisescale = 32;
|
||||||
|
colorLoop = 0;
|
||||||
|
drawNoise3d(blackAndBlueStripedPalette);
|
||||||
|
}
|
||||||
|
|
158
README.md
@ -1,131 +1,56 @@
|
|||||||
Nanoleaf Web Server
|
ULTiM8x8 Cube + FastLED + ESP8266 Web Server
|
||||||
=========
|
=========
|
||||||
|
|
||||||
This is a fork of [jasoncoon's esp8266 fastled webserver](https://github.com/jasoncoon/esp8266-fastled-webserver) that was adapted to control the colors of my [DIY-Nanoleaf Replica](https://www.thingiverse.com/thing:3354082).
|
Control an RGB LED cube with an ESP8266 via a web browser.
|
||||||
|
|
||||||
[](https://www.thingiverse.com/thing:3354082)
|
[](https://i.imgur.com/SCHDFGx.gifv)
|
||||||
|
|
||||||
Hardware
|
Hardware
|
||||||
--------
|
--------
|
||||||
|
|
||||||
##### ESP8266
|
##### ESP8266 development board
|
||||||
|
|
||||||

|
[](https://www.adafruit.com/product/2821)
|
||||||
|
|
||||||
[Wemos D1 mini](http://s.click.aliexpress.com/e/cBDdafPw) is recommended, but any other ESP8266 variant should work too, but it might require an additional step-down converter.
|
[Adafruit Feather HUZZAH with ESP8266 WiFi](https://www.adafruit.com/product/2821)
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
[](https://www.aliexpress.com/item/WEMOS-D1-mini-Pro-16M-bytes-external-antenna-connector-ESP8266-WIFI-Internet-of-Things-development-board/32724692514.html)
|
||||||
|
|
||||||
**Addressable Led Strip**
|
[Wemos D1 Mini Pro & Headers](https://www.aliexpress.com/item/WEMOS-D1-mini-Pro-16M-bytes-external-antenna-connector-ESP8266-WIFI-Internet-of-Things-development-board/32724692514.html)
|
||||||
|
|
||||||

|
##### 6 x ULTiM8x8 RGB LED panels
|
||||||
|
|
||||||
I have used 12 led pixels per leaf → 1m of 60 leds/m = 5 leafs
|
[](http://wyolum.com/ultim8x8/)
|
||||||
|
|
||||||
I would recommend buying a strip with 60 leds/m or more.
|
[ULTiM8x8 RGB LED panels](http://wyolum.com/ultim8x8/)
|
||||||
|
|
||||||
[WS2812b led strip](http://s.click.aliexpress.com/e/SkQFQqc), make sure you choose IP30 any other IP rating wouldn't make any sense and might not even fit.
|
Other hardware:
|
||||||
|
|
||||||
|
* [3.3V to 5V Logic Level Shifter](http://www.digikey.com/product-detail/en/texas-instruments/SN74HCT245N/296-1612-5-ND/277258) (required if LEDs "glitch")
|
||||||
|
|
||||||
|
Recommended by [Adafruit NeoPixel "Best Practices"](https://learn.adafruit.com/adafruit-neopixel-uberguide/best-practices) to help protect LEDs from current onrush:
|
||||||
|
* [1000µF Capacitor](http://www.digikey.com/product-detail/en/panasonic-electronic-components/ECA-1EM102/P5156-ND/245015)
|
||||||
|
* [300 to 500 Ohm resistor](https://www.digikey.com/product-detail/en/stackpole-electronics-inc/CF14JT470R/CF14JT470RCT-ND/1830342)
|
||||||
|
|
||||||
Other (optional) hardware:
|
Optional shield to make everything more tidy:
|
||||||
|
|
||||||
* [3.3V to 5V Logic Level Shifter](http://s.click.aliexpress.com/e/buDr0PT2) (required if LEDs "glitch")
|
[](https://www.tindie.com/products/jasoncoon/wemos-d1-mini-esp8266-led-and-level-shifter-shield/)
|
||||||
|
|
||||||
|
[Wemos D1 Mini ESP8266 LED & Level Shifter Shield](https://www.tindie.com/products/jasoncoon/wemos-d1-mini-esp8266-led-and-level-shifter-shield)
|
||||||
|
|
||||||
Features
|
Features
|
||||||
--------
|
--------
|
||||||
* Control the colors of individual leafs
|
* Turn the LEDs on and off
|
||||||
* Adjust the brightness
|
* Adjust the brightness
|
||||||
* Change the display pattern
|
* Change the display pattern
|
||||||
* Adjust the color
|
* Adjust the color
|
||||||
* Adapted patterns to look great on the [DIY-Nanoleaf Replica](https://www.thingiverse.com/thing:3354082)
|
|
||||||
* OTA-Update support
|
|
||||||
|
|
||||||
|
Web App
|
||||||
|
|
||||||
### Upcoming Features
|
|
||||||
|
|
||||||
- **Node-RED** integration
|
|
||||||
- Custom-Alexa skill
|
|
||||||
- Nanoleaf voice control
|
|
||||||
- Custom color pattern designer
|
|
||||||
- **Node-RED** webinterface to store special patterns persistant
|
|
||||||
- Controlling multiple nanoleafs at once
|
|
||||||
|
|
||||||
> these features will be optional and require additional hardware (any linux/windows device that is in the same network)
|
|
||||||
|
|
||||||
Webinterface
|
|
||||||
--------
|
--------
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The web app is stored in SPIFFS (on-board flash memory).
|
|
||||||
|
|
||||||
Installing
|
|
||||||
-----------
|
|
||||||
The app is installed via the Arduino IDE which can be [downloaded here](https://www.arduino.cc/en/main/software). The ESP8266 boards will need to be added to the Arduino IDE which is achieved as follows. Click File > Preferences and copy and paste the URL "http://arduino.esp8266.com/stable/package_esp8266com_index.json" into the Additional Boards Manager URLs field. Click OK. Click Tools > Boards: ... > Boards Manager. Find and click on ESP8266 (using the Search function may expedite this). Click on Install. After installation, click on Close and then select your ESP8266 board from the Tools > Board: ... menu.
|
|
||||||
|
|
||||||
The app depends on the following libraries. They must either be downloaded from GitHub and placed in the Arduino 'libraries' folder, or installed as [described here](https://www.arduino.cc/en/Guide/Libraries) by using the Arduino library manager.
|
|
||||||
|
|
||||||
* [FastLED](https://github.com/FastLED/FastLED)
|
|
||||||
* [Arduino WebSockets](https://github.com/Links2004/arduinoWebSockets)
|
|
||||||
|
|
||||||
Download the app code from GitHub using the green Clone or Download button from [GitHub](https://github.com/NimmLor/esp8266-fastled-webserver) and click Download ZIP. Decompress the ZIP file in your Arduino sketch folder.
|
|
||||||
|
|
||||||
The web app needs to be uploaded to the ESP8266's SPIFFS. You can do this within the Arduino IDE after installing the [Arduino ESP8266FS tool](http://esp8266.github.io/Arduino/versions/2.3.0/doc/filesystem.html#uploading-files-to-file-system). An alternative would be to install the [Visual Micro](https://www.visualmicro.com/) plugin for Visual Studio.
|
|
||||||
|
|
||||||
With ESP8266FS installed upload the web app using `ESP8266 Sketch Data Upload` command in the Arduino Tools menu.
|
|
||||||
|
|
||||||
## Configuration
|
|
||||||
|
|
||||||
The most important thing to do is to set the amount of 'leafs' and the amount of led pixels that one 'leaf' contains.
|
|
||||||
|
|
||||||
For instance I use 12 leafs (triangles) with a total of 12 pixels in one leaf (=4 leds in each corner of the triangle).
|
|
||||||
|
|
||||||
```c++
|
|
||||||
#define LEAFCOUNT 12
|
|
||||||
#define PIXELS_PER_LEAF 12
|
|
||||||
```
|
|
||||||
|
|
||||||
Next enter the pin where the *Data* line is connected to, in my case it's pin D4 (you can either write D4 or 2).
|
|
||||||
|
|
||||||
`#define DATA_PIN D4`
|
|
||||||
|
|
||||||
Another **important** step is to create the **Secrets.h** file. Create a new tab (**ctrl**+**shift**+**n**) and name it *Secrets.h*, this file contains your WIFI credentials and it's structure must look like this:
|
|
||||||
|
|
||||||
``````c++
|
|
||||||
// AP mode password
|
|
||||||
const char WiFiAPPSK[] = "WIFI_NAME_IF_IN_AP_MODE";
|
|
||||||
|
|
||||||
// Wi-Fi network to connect to (if not in AP mode)
|
|
||||||
char* ssid = "YOUR_WIFI_NAME";
|
|
||||||
char* password = "YOUR_WIFI_PASSWORD";
|
|
||||||
``````
|
|
||||||
|
|
||||||
If colors appear to be swapped you should change the color order. For me, red and green was swapped so i had to change the color order from *RGB* to *GRB*.
|
|
||||||
|
|
||||||
You should also set the milli-amps of your power supply to prevent power overloading. I am using a 3A 5V psu so i defined 3000mA.
|
|
||||||
|
|
||||||
`#define MILLI_AMPS 3000`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Circuit
|
|
||||||
|
|
||||||
### Without Logic-Level Converter
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### With Logic-Level-Converter (required if leds 'glitch')
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Technical information
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
Patterns are requested by the app from the ESP8266, so as new patterns are added, they're automatically listed in the app.
|
Patterns are requested by the app from the ESP8266, so as new patterns are added, they're automatically listed in the app.
|
||||||
|
|
||||||
@ -135,6 +60,41 @@ The web app is a single page app that uses [jQuery](https://jquery.com) and [Boo
|
|||||||
|
|
||||||
The only drawback to SPIFFS that I've found so far is uploading the files can be extremely slow, requiring several minutes, sometimes regardless of how large the files are. It can be so slow that I've been just developing the web app and debugging locally on my desktop (with a hard-coded IP for the ESP8266), before uploading to SPIFFS and testing on the ESP8266.
|
The only drawback to SPIFFS that I've found so far is uploading the files can be extremely slow, requiring several minutes, sometimes regardless of how large the files are. It can be so slow that I've been just developing the web app and debugging locally on my desktop (with a hard-coded IP for the ESP8266), before uploading to SPIFFS and testing on the ESP8266.
|
||||||
|
|
||||||
|
Installing
|
||||||
|
-----------
|
||||||
|
The app is installed via the Arduino IDE which can be [downloaded here](https://www.arduino.cc/en/main/software). The ESP8266 boards will need to be added to the Arduino IDE which is achieved as follows. Click File > Preferences and copy and paste the URL "http://arduino.esp8266.com/stable/package_esp8266com_index.json" into the Additional Boards Manager URLs field. Click OK. Click Tools > Boards: ... > Boards Manager. Find and click on ESP8266 (using the Search function may expedite this). Click on Install. After installation, click on Close and then select your ESP8266 board from the Tools > Board: ... menu.
|
||||||
|
|
||||||
|
The app depends on the following libraries. They must either be downloaded from GitHub and placed in the Arduino 'libraries' folder, or installed as [described here](https://www.arduino.cc/en/Guide/Libraries) by using the Arduino library manager.
|
||||||
|
|
||||||
|
* [FastLED](https://github.com/FastLED/FastLED)
|
||||||
|
* [IRremoteESP8266](https://github.com/sebastienwarin/IRremoteESP8266)
|
||||||
|
* [Arduino WebSockets](https://github.com/Links2004/arduinoWebSockets)
|
||||||
|
|
||||||
|
Download the app code from GitHub using the green Clone or Download button from [the GitHub project main page](https://github.com/jasoncoon/esp8266-fastled-webserver) and click Download ZIP. Decompress the ZIP file in your Arduino sketch folder.
|
||||||
|
|
||||||
|
The web app needs to be uploaded to the ESP8266's SPIFFS. You can do this within the Arduino IDE after installing the [Arduino ESP8266FS tool](https://github.com/esp8266/Arduino/blob/master/doc/filesystem.md#uploading-files-to-file-system).
|
||||||
|
|
||||||
|
With ESP8266FS installed upload the web app using `ESP8266 Sketch Data Upload` command in the Arduino Tools menu.
|
||||||
|
|
||||||
|
Then enter your wi-fi network SSID and password in the .ino file, and upload the sketch using the Upload button.
|
||||||
|
|
||||||
|
Compression
|
||||||
|
-----------
|
||||||
|
|
||||||
|
The web app files can be gzip compressed before uploading to SPIFFS by running the following command:
|
||||||
|
|
||||||
|
`gzip -r data/`
|
||||||
|
|
||||||
|
The ESP8266WebServer will automatically serve any .gz file. The file index.htm.gz will get served as index.htm, with the content-encoding header set to gzip, so the browser knows to decompress it. The ESP8266WebServer doesn't seem to like the Glyphicon fonts gzipped, though, so I decompress them with this command:
|
||||||
|
|
||||||
|
`gunzip -r data/fonts/`
|
||||||
|
|
||||||
|
REST Web services
|
||||||
|
-----------------
|
||||||
|
|
||||||
The firmware implements basic [RESTful web services](https://en.wikipedia.org/wiki/Representational_state_transfer) using the ESP8266WebServer library. Current values are requested with HTTP GETs, and values are set with POSTs using query string parameters. It can run in connected or standalone access point modes.
|
The firmware implements basic [RESTful web services](https://en.wikipedia.org/wiki/Representational_state_transfer) using the ESP8266WebServer library. Current values are requested with HTTP GETs, and values are set with POSTs using query string parameters. It can run in connected or standalone access point modes.
|
||||||
|
|
||||||
|
Infrared Remote Control
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
Control via infrared remote control is also supported, via the [ESP8266 port of the IRremote library](https://github.com/sebastienwarin/IRremoteESP8266).
|
||||||
|
BIN
SCHDFGx.gif
Normal file
After Width: | Height: | Size: 27 MiB |
103
TwinkleFOX.h
@ -103,8 +103,7 @@ uint8_t attackDecayWave8(uint8_t i)
|
|||||||
{
|
{
|
||||||
if( i < 86) {
|
if( i < 86) {
|
||||||
return i * 3;
|
return i * 3;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
i -= 86;
|
i -= 86;
|
||||||
return 255 - (i + (i/2));
|
return 255 - (i + (i/2));
|
||||||
}
|
}
|
||||||
@ -152,8 +151,7 @@ CRGB computeOneTwinkle(uint32_t ms, uint8_t salt)
|
|||||||
if( COOL_LIKE_INCANDESCENT == 1 ) {
|
if( COOL_LIKE_INCANDESCENT == 1 ) {
|
||||||
coolLikeIncandescent( c, fastcycle8);
|
coolLikeIncandescent( c, fastcycle8);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
c = CRGB::Black;
|
c = CRGB::Black;
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
@ -185,96 +183,12 @@ void drawTwinkles()
|
|||||||
uint8_t bglight = bg.getAverageLight();
|
uint8_t bglight = bg.getAverageLight();
|
||||||
if( bglight > 64) {
|
if( bglight > 64) {
|
||||||
bg.nscale8_video( 16); // very bright, so scale to 1/16th
|
bg.nscale8_video( 16); // very bright, so scale to 1/16th
|
||||||
}
|
} else if( bglight > 16) {
|
||||||
else if (bglight > 16) {
|
|
||||||
bg.nscale8_video( 64); // not that bright, so scale to 1/4th
|
bg.nscale8_video( 64); // not that bright, so scale to 1/4th
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
bg.nscale8_video( 86); // dim, scale to 1/3rd.
|
bg.nscale8_video( 86); // dim, scale to 1/3rd.
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
bg = gBackgroundColor; // just use the explicitly defined background color
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t backgroundBrightness = bg.getAverageLight();
|
|
||||||
|
|
||||||
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
|
|
||||||
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.
|
|
||||||
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
|
bg = gBackgroundColor; // just use the explicitly defined background color
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -302,20 +216,17 @@ void drawTwinkles()
|
|||||||
// If the new pixel is significantly brighter than the background color,
|
// If the new pixel is significantly brighter than the background color,
|
||||||
// use the new color.
|
// use the new color.
|
||||||
pixel = c;
|
pixel = c;
|
||||||
}
|
} else if( deltabright > 0 ) {
|
||||||
else if (deltabright > 0) {
|
|
||||||
// If the new pixel is just slightly brighter than the background color,
|
// If the new pixel is just slightly brighter than the background color,
|
||||||
// mix a blend of the new color and the background color
|
// mix a blend of the new color and the background color
|
||||||
pixel = blend( bg, c, deltabright * 8);
|
pixel = blend( bg, c, deltabright * 8);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// if the new pixel is not at all brighter than the background color,
|
// if the new pixel is not at all brighter than the background color,
|
||||||
// just use the background color.
|
// just use the background color.
|
||||||
pixel = bg;
|
pixel = bg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// A mostly red palette with green accents and white trim.
|
// A mostly red palette with green accents and white trim.
|
||||||
// "CRGB::Gray" is used as white to keep the brightness more uniform.
|
// "CRGB::Gray" is used as white to keep the brightness more uniform.
|
||||||
|
25
Twinkles.h
@ -53,18 +53,17 @@ void setPixelDirection(uint16_t i, bool dir)
|
|||||||
|
|
||||||
void brightenOrDarkenEachPixel( fract8 fadeUpAmount, fract8 fadeDownAmount)
|
void brightenOrDarkenEachPixel( fract8 fadeUpAmount, fract8 fadeDownAmount)
|
||||||
{
|
{
|
||||||
for (uint16_t i = 0; i < LEAFCOUNT; i++) {
|
for ( uint16_t i = 0; i < NUM_LEDS; i++) {
|
||||||
if (getPixelDirection(i*PIXELS_PER_LEAF) == GETTING_DARKER) {
|
if ( getPixelDirection(i) == GETTING_DARKER) {
|
||||||
// This pixel is getting darker
|
// This pixel is getting darker
|
||||||
for (int i2 = 0; i2 < PIXELS_PER_LEAF; i2++)leds[i*PIXELS_PER_LEAF + i2] = makeDarker(leds[i*PIXELS_PER_LEAF + i2], fadeDownAmount);
|
leds[i] = makeDarker( leds[i], fadeDownAmount);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// This pixel is getting brighter
|
// This pixel is getting brighter
|
||||||
for (int i2 = 0; i2 < PIXELS_PER_LEAF; i2++)leds[i*PIXELS_PER_LEAF + i2] = makeBrighter(leds[i*PIXELS_PER_LEAF + i2], fadeUpAmount);
|
leds[i] = makeBrighter( leds[i], fadeUpAmount);
|
||||||
// now check to see if we've maxxed out the brightness
|
// now check to see if we've maxxed out the brightness
|
||||||
if (leds[i*PIXELS_PER_LEAF].r == 255 || leds[i*PIXELS_PER_LEAF].g == 255 || leds[i*PIXELS_PER_LEAF].b == 255) {
|
if ( leds[i].r == 255 || leds[i].g == 255 || leds[i].b == 255) {
|
||||||
// if so, turn around and start getting darker
|
// if so, turn around and start getting darker
|
||||||
for (int i2 = 0; i2 < PIXELS_PER_LEAF; i2++)setPixelDirection(i*PIXELS_PER_LEAF + i2, GETTING_DARKER);
|
setPixelDirection(i, GETTING_DARKER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -80,14 +79,10 @@ void colortwinkles()
|
|||||||
|
|
||||||
// Now consider adding a new random twinkle
|
// Now consider adding a new random twinkle
|
||||||
if ( random8() < DENSITY ) {
|
if ( random8() < DENSITY ) {
|
||||||
int pos = random16(LEAFCOUNT);
|
int pos = random16(NUM_LEDS);
|
||||||
if ( !leds[pos]) {
|
if ( !leds[pos]) {
|
||||||
uint8_t rdo = random8();
|
leds[pos] = ColorFromPalette( gCurrentPalette, random8(), STARTING_BRIGHTNESS, NOBLEND);
|
||||||
for (int i = 0; i < PIXELS_PER_LEAF; i++)
|
setPixelDirection(pos, GETTING_BRIGHTER);
|
||||||
{
|
|
||||||
leds[pos*PIXELS_PER_LEAF + i] = ColorFromPalette(gCurrentPalette, rdo, STARTING_BRIGHTNESS, NOBLEND);
|
|
||||||
setPixelDirection(pos*PIXELS_PER_LEAF + i, GETTING_BRIGHTER);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,20 @@
|
|||||||
padding-bottom: 70px;
|
padding-bottom: 70px;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
.grid-item-color-button {
|
||||||
|
border: 0px;
|
||||||
|
width: 7.69%;
|
||||||
|
height: 64px;
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.grid-item-color {
|
.grid-item-color {
|
||||||
width: 4%;
|
border: none;
|
||||||
|
width: 3.33%;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
cursor: pointer;
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.grid-item-pattern {
|
.grid-item-pattern {
|
||||||
|
Before Width: | Height: | Size: 6.4 KiB |
@ -1,20 +1,27 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>ESP8266 + FastLED by Evil Genius Labs</title>
|
<title>Cube by Evil Genius Labs</title>
|
||||||
|
|
||||||
<!-- request CSS from internet CDN -->
|
<!-- request CSS from internet CDN -->
|
||||||
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> -->
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||||
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-minicolors/2.2.4/jquery.minicolors.min.css" integrity="sha256-4wnSkPYU5B4yngAlx/rEb8LdfMah4teUth4AfhGEuaY=" crossorigin="anonymous" /> -->
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-minicolors/2.2.4/jquery.minicolors.min.css" integrity="sha256-4wnSkPYU5B4yngAlx/rEb8LdfMah4teUth4AfhGEuaY=" crossorigin="anonymous" />
|
||||||
|
|
||||||
<!-- request CSS from the ESP8266 web server -->
|
<!-- request CSS from the ESP8266 web server -->
|
||||||
<link rel="stylesheet" href="css/bootstrap.min.css">
|
<!-- <link rel="stylesheet" href="css/bootstrap.min.css"> -->
|
||||||
<link rel="stylesheet" href="css/minicolors.min.css">
|
<!-- <link rel="stylesheet" href="css/jquery.minicolors.min.css"> -->
|
||||||
|
|
||||||
<link rel="stylesheet" href="css/styles.css">
|
<link rel="stylesheet" href="css/styles.css">
|
||||||
|
|
||||||
<link rel="icon" href="images/atom196.png">
|
<link rel="icon" href="images/atom196.png">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<nav class="navbar navbar-default navbar-static-top" id="top" role="banner">
|
<nav class="navbar navbar-default navbar-static-top" id="top" role="banner">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
@ -24,36 +31,42 @@
|
|||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand" href="https://www.evilgeniuslabs.org" target="_blank"><img src="/images/atom196.png" style="width: 24px; height: 24px;" /></a>
|
<a class="navbar-brand" href="https://www.evilgeniuslabs.org" target="_blank"><img src="https://evilgeniuslabs.org/images/atom.svg" style="width: 24px; height: 24px;" /></a>
|
||||||
<a class="navbar-brand" href="https://www.evilgeniuslabs.org" target="_blank">Evil Genius Labs</a>
|
<a class="navbar-brand" href="https://www.evilgeniuslabs.org" target="_blank">Evil Genius Labs</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="collapse navbar-collapse" id="navbar-collapse-1">
|
<div class="collapse navbar-collapse" id="navbar-collapse-1">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li class="active"><a href="/">DIY Nanoleaf control <span class="sr-only">(current)</span></a></li>
|
<li class="active"><a href="/">Cube <span class="sr-only">(current)</span></a></li>
|
||||||
<li><a href="/simple.htm" target="_blank" title="Simple Mode">Simple</a></li>
|
<li><a href="/simple.htm" target="_blank" title="Simple Mode">Simple</a></li>
|
||||||
<li><a href="/edit.htm" target="_blank" title="Edit Files">Files</a></li>
|
<li><a href="/edit.htm" target="_blank" title="Edit Files">Files</a></li>
|
||||||
<li><a href="/update" target="_blank" title="Update Firmware">Firmware</a></li>
|
<li><a href="/update" target="_blank" title="Update Firmware">Firmware</a></li>
|
||||||
<li><a href="/wifi.htm" target="_blank" title="Wi-Fi Settings">Wi-Fi</a></li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
<li>
|
<li>
|
||||||
<a href="https://github.com/jasoncoon/esp8266-fastled-webserver">
|
<a href="https://github.com/jasoncoon/esp8266-fastled-webserver">
|
||||||
<img style="height: 16px;" src="/images/github.ico" />
|
<img style="height: 16px;" src="https://assets-cdn.github.com/favicon.ico" />
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div id="container" class="container">
|
<div id="container" class="container">
|
||||||
<form class="form-horizontal" id="form"></form>
|
|
||||||
|
<form class="form-horizontal" id="form">
|
||||||
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="templates" style="display: none">
|
<div id="templates" style="display: none">
|
||||||
|
|
||||||
<div id="sectionTemplate" class="form-group">
|
<div id="sectionTemplate" class="form-group">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<hr style="margin-bottom: 5px;margin-top: 5px;" />
|
<hr style="margin-bottom: 5px;margin-top: 5px;" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="numberTemplate" class="form-group">
|
<div id="numberTemplate" class="form-group">
|
||||||
<label class="col-sm-2 control-label"></label>
|
<label class="col-sm-2 control-label"></label>
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
@ -63,6 +76,7 @@
|
|||||||
<input class="form-control slider" type="range" step="1" min="0" max="255" />
|
<input class="form-control slider" type="range" step="1" min="0" max="255" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="booleanTemplate" class="form-group">
|
<div id="booleanTemplate" class="form-group">
|
||||||
<label class="col-sm-2 control-label"></label>
|
<label class="col-sm-2 control-label"></label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
@ -72,6 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="selectTemplate" class="form-group">
|
<div id="selectTemplate" class="form-group">
|
||||||
<label class="col-sm-2 control-label"></label>
|
<label class="col-sm-2 control-label"></label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
@ -91,36 +106,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="booleanTemplate" class="form-group">
|
|
||||||
<label class="col-sm-2 control-label"></label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<div class="btn-group" role="group">
|
|
||||||
<button type="button" class="btn btn-default" id="btnOn">On</button>
|
|
||||||
<button type="button" class="btn btn-default" id="btnOff">Off</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="selectTemplate" class="form-group">
|
|
||||||
<label class="col-sm-2 control-label"></label>
|
|
||||||
<div class="col-sm-8">
|
|
||||||
<select class="form-control"><select>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-2">
|
|
||||||
<div class="btn-group" role="group" aria-label="...">
|
|
||||||
<button type="button" class="btn btn-default btn-previous"
|
|
||||||
aria-label="Previous" title="Previous">
|
|
||||||
<span class="glyphicon glyphicon-chevron-left"></span>
|
|
||||||
</button>
|
|
||||||
<button type="button" class="btn btn-default btn-next"
|
|
||||||
aria-label="Next" title="Next">
|
|
||||||
<span class="glyphicon glyphicon-chevron-right"></span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="colorPaletteTemplate" class="form-group">
|
<div id="colorPaletteTemplate" class="form-group">
|
||||||
<label class="col-sm-2 control-label color-label"></label>
|
<label class="col-sm-2 control-label color-label"></label>
|
||||||
|
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<div class="btn-group btn-group-justified" role="group">
|
<div class="btn-group btn-group-justified" role="group">
|
||||||
<div class="btn-group" role="group">
|
<div class="btn-group" role="group">
|
||||||
@ -165,6 +152,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="colorTemplate">
|
<div id="colorTemplate">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<!-- <label class="col-sm-2 control-label color-label"></label> -->
|
<!-- <label class="col-sm-2 control-label color-label"></label> -->
|
||||||
@ -200,7 +188,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<nav class="navbar navbar-default navbar-fixed-bottom">
|
<nav class="navbar navbar-default navbar-fixed-bottom">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
@ -223,16 +213,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<!-- request js from internet CDN -->
|
<!-- request js from internet CDN -->
|
||||||
<!-- <script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> -->
|
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
|
||||||
<!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> -->
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-minicolors/2.2.4/jquery.minicolors.min.js" integrity="sha256-XAFQ9dZ6hy8p/GRhU8h/8pMvM1etymiJLZW1CiHV3bQ=" crossorigin="anonymous"></script> -->
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-minicolors/2.2.4/jquery.minicolors.min.js" integrity="sha256-XAFQ9dZ6hy8p/GRhU8h/8pMvM1etymiJLZW1CiHV3bQ=" crossorigin="anonymous"></script>
|
||||||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/reconnecting-websocket/1.0.0/reconnecting-websocket.min.js" integrity="sha256-A4JwlcDvqO4JXpvEtvWY1RH8JAEMu5W21wP8GUXLUNs=" crossorigin="anonymous"></script> -->
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/reconnecting-websocket/1.0.0/reconnecting-websocket.min.js" integrity="sha256-A4JwlcDvqO4JXpvEtvWY1RH8JAEMu5W21wP8GUXLUNs=" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
<!-- request js from the ESP8266 web server -->
|
<!-- request js from the ESP8266 web server -->
|
||||||
<script src="js/jquery-3.1.1.min.js"></script>
|
<!-- <script src="js/jquery-3.1.1.min.js"></script> -->
|
||||||
<script src="js/bootstrap.min.js"></script>
|
<!-- <script src="js/bootstrap.min.js"></script> -->
|
||||||
<script src="js/minicolors.min.js"></script>
|
<!-- <script src="js/jquery.minicolors.min.js"></script> -->
|
||||||
<script src="js/r-websocket.min.js"></script>
|
<!-- <script src="js/r-websocket.min.js"></script> -->
|
||||||
|
|
||||||
<script src="js/app.js"></script>
|
<script src="js/app.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -3,7 +3,7 @@ var address = location.hostname;
|
|||||||
var urlBase = "";
|
var urlBase = "";
|
||||||
|
|
||||||
// used when hosting the site somewhere other than the ESP8266 (handy for testing without waiting forever to upload to SPIFFS)
|
// used when hosting the site somewhere other than the ESP8266 (handy for testing without waiting forever to upload to SPIFFS)
|
||||||
// var address = "esp8266-1920f7.local";
|
// var address = "192.168.86.55";
|
||||||
// var urlBase = "http://" + address + "/";
|
// var urlBase = "http://" + address + "/";
|
||||||
|
|
||||||
var postColorTimer = {};
|
var postColorTimer = {};
|
||||||
|
@ -3,7 +3,7 @@ var address = location.hostname;
|
|||||||
var urlBase = "";
|
var urlBase = "";
|
||||||
|
|
||||||
// used when hosting the site somewhere other than the ESP8266 (handy for testing without waiting forever to upload to SPIFFS)
|
// used when hosting the site somewhere other than the ESP8266 (handy for testing without waiting forever to upload to SPIFFS)
|
||||||
// var address = "192.168.1.13";
|
// var address = "192.168.86.55";
|
||||||
// var urlBase = "http://" + address + "/";
|
// var urlBase = "http://" + address + "/";
|
||||||
|
|
||||||
var postColorTimer = {};
|
var postColorTimer = {};
|
||||||
@ -15,6 +15,27 @@ var patterns = [
|
|||||||
"Pride",
|
"Pride",
|
||||||
"Color Waves",
|
"Color Waves",
|
||||||
|
|
||||||
|
"X Gradient Palette",
|
||||||
|
"Y Gradient Palette",
|
||||||
|
"Z Gradient Palette",
|
||||||
|
|
||||||
|
"XY Gradient Palette",
|
||||||
|
"XZ Gradient Palette",
|
||||||
|
"YZ Gradient Palette",
|
||||||
|
"XYZ Gradient Palette",
|
||||||
|
|
||||||
|
"Fire Noise",
|
||||||
|
"Fire Noise 2",
|
||||||
|
"Lava Noise",
|
||||||
|
"Rainbow Noise",
|
||||||
|
"Rainbow Stripe Noise",
|
||||||
|
"Party Noise",
|
||||||
|
"Forest Noise",
|
||||||
|
"Cloud Noise",
|
||||||
|
"Ocean Noise",
|
||||||
|
"Black & White Noise",
|
||||||
|
"Black & Blue Noise",
|
||||||
|
|
||||||
"Rainbow Twinkles",
|
"Rainbow Twinkles",
|
||||||
"Snow Twinkles",
|
"Snow Twinkles",
|
||||||
"Cloud Twinkles",
|
"Cloud Twinkles",
|
||||||
@ -35,15 +56,11 @@ var patterns = [
|
|||||||
"Cloud 2 Twinkles",
|
"Cloud 2 Twinkles",
|
||||||
"Ocean Twinkles",
|
"Ocean Twinkles",
|
||||||
|
|
||||||
"Rainbow",
|
|
||||||
"Rainbow With Glitter",
|
|
||||||
"Solid Rainbow",
|
"Solid Rainbow",
|
||||||
"Confetti",
|
"Confetti",
|
||||||
"Sinelon",
|
"Sinelon",
|
||||||
"Beat",
|
"Beat",
|
||||||
"Juggle",
|
"Juggle",
|
||||||
"Fire",
|
|
||||||
"Water"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
var ws = new ReconnectingWebSocket('ws://' + address + ':81/', ['arduino']);
|
var ws = new ReconnectingWebSocket('ws://' + address + ':81/', ['arduino']);
|
||||||
@ -114,13 +131,13 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function addColorButtons() {
|
function addColorButtons() {
|
||||||
var hues = 25;
|
var hues = 30;
|
||||||
var hueStep = 360 / hues;
|
var hueStep = 360 / hues;
|
||||||
|
|
||||||
var levels = 10;
|
var levels = 25;
|
||||||
var levelStep = 60 / levels;
|
var levelStep = 50 / levels;
|
||||||
|
|
||||||
for(var l = 20; l < 80; l += levelStep) {
|
for(var l = 50; l < 95; l += levelStep) {
|
||||||
for(var h = 0; h < hues; h++) {
|
for(var h = 0; h < hues; h++) {
|
||||||
addColorButton(h * hueStep, 100, l);
|
addColorButton(h * hueStep, 100, l);
|
||||||
}
|
}
|
||||||
@ -131,24 +148,35 @@ function addColorButtons() {
|
|||||||
layoutMode: 'fitRows'
|
layoutMode: 'fitRows'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.grid-color-buttons').isotope({
|
||||||
|
itemSelector: '.grid-item-color-button',
|
||||||
|
layoutMode: 'fitRows'
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.grid-item-color-button').click(colorButtonClick);
|
||||||
}
|
}
|
||||||
|
|
||||||
var colorButtonIndex = 0;
|
var colorButtonIndex = 0;
|
||||||
|
|
||||||
function addColorButton(h, s, l) {
|
function colorButtonClick() {
|
||||||
var color = "hsla(" + h + ", " + s + "%, " + l + "%, 1)"
|
|
||||||
var template = $("#colorButtonTemplate").clone();
|
|
||||||
template.attr("id", "color-button-" + colorButtonIndex++);
|
|
||||||
template.css("background-color", color);
|
|
||||||
template.click(function() {
|
|
||||||
var rgb = $(this).css('backgroundColor');
|
var rgb = $(this).css('backgroundColor');
|
||||||
var components = rgbToComponents(rgb);
|
var components = rgbToComponents(rgb);
|
||||||
|
|
||||||
$(".grid-item-color").css("border", "none");
|
$(".grid-item-color").css("border", "none");
|
||||||
|
|
||||||
|
if($(this).attr("class") === "grid-item-color") {
|
||||||
$(this).css("border", "1px solid");
|
$(this).css("border", "1px solid");
|
||||||
|
}
|
||||||
|
|
||||||
postColor("solidColor", components);
|
postColor("solidColor", components);
|
||||||
});
|
}
|
||||||
|
|
||||||
|
function addColorButton(h, s, l) {
|
||||||
|
var color = "hsl(" + h + ", " + s + "%, " + l + "%)"
|
||||||
|
var template = $("#colorButtonTemplate").clone();
|
||||||
|
template.css("background-color", color);
|
||||||
|
template.attr("title", template.css("background-color") + "\r\n" + color);
|
||||||
|
template.click(colorButtonClick);
|
||||||
|
|
||||||
$("#colorButtonsRow").append(template);
|
$("#colorButtonsRow").append(template);
|
||||||
}
|
}
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>ESP8266 + FastLED by Evil Genius Labs</title>
|
<title>Cube by Evil Genius Labs</title>
|
||||||
|
|
||||||
<!-- request CSS from internet CDN -->
|
<!-- request CSS from internet CDN -->
|
||||||
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> -->
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||||
|
|
||||||
<!-- request CSS from the ESP8266 web server -->
|
<!-- request CSS from the ESP8266 web server -->
|
||||||
<link rel="stylesheet" href="css/bootstrap.min.css">
|
<!-- <link rel="stylesheet" href="css/bootstrap.min.css"> -->
|
||||||
|
|
||||||
<link rel="stylesheet" href="css/simple.css">
|
<link rel="stylesheet" href="css/simple.css">
|
||||||
|
|
||||||
@ -20,37 +20,58 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div id="container" class="container">
|
<div id="container" class="container-fluid">
|
||||||
|
|
||||||
<div style="margin: 5px;">
|
<div style="margin: 5px;">
|
||||||
<button type="button" class="btn btn-default" id="btnOn">On</button>
|
<button type="button" class="btn btn-default" id="btnOn">On</button>
|
||||||
<button type="button" class="btn btn-default" id="btnOff">Off</button>
|
<button type="button" class="btn btn-default" id="btnOff">Off</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h4>Patterns</h4>
|
||||||
|
|
||||||
<div id="patternGrid" class="grid-pattern"></div>
|
<div id="patternGrid" class="grid-pattern"></div>
|
||||||
|
|
||||||
|
<h4>Basic Colors</h4>
|
||||||
|
|
||||||
|
<div class="grid-color-buttons">
|
||||||
|
<button type="button" class="grid-item-color-button" style="background: #FF0000;" title="Red"> </button>
|
||||||
|
<button type="button" class="grid-item-color-button" style="background: #FF8000;" title="Orange"> </button>
|
||||||
|
<button type="button" class="grid-item-color-button" style="background: #FFFF00;" title="Yellow"> </button>
|
||||||
|
<button type="button" class="grid-item-color-button" style="background: #80FF00;" title="Chartreuse"> </button>
|
||||||
|
<button type="button" class="grid-item-color-button" style="background: #00FF00;" title="Green"> </button>
|
||||||
|
<button type="button" class="grid-item-color-button" style="background: #00FF80;" title="Spring Green"> </button>
|
||||||
|
<button type="button" class="grid-item-color-button" style="background: #00FFFF;" title="Cyan"> </button>
|
||||||
|
<button type="button" class="grid-item-color-button" style="background: #0080FF;" title="Azure"> </button>
|
||||||
|
<button type="button" class="grid-item-color-button" style="background: #0000FF;" title="Blue"> </button>
|
||||||
|
<button type="button" class="grid-item-color-button" style="background: #8000FF;" title="Violet"> </button>
|
||||||
|
<button type="button" class="grid-item-color-button" style="background: #FF00FF;" title="Magenta"> </button>
|
||||||
|
<button type="button" class="grid-item-color-button" style="background: #FF0080;" title="Rose"> </button>
|
||||||
|
<button type="button" class="grid-item-color-button" style="background: #FFFFFF; border: 1px solid;" title="White"> </button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h4>Color Palette</h4>
|
||||||
|
|
||||||
<div id="colorButtonsRow" class="grid-color"></div>
|
<div id="colorButtonsRow" class="grid-color"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="templates" style="display: none">
|
<div id="templates" style="display: none">
|
||||||
|
|
||||||
<div id="colorButtonTemplate" class="grid-item-color"></div>
|
<button id="colorButtonTemplate" class="grid-item-color"></button>
|
||||||
|
|
||||||
<button id="patternButtonTemplate" class="grid-item-pattern btn btn-default"></button>
|
<button id="patternButtonTemplate" class="grid-item-pattern btn btn-default"></button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- request js from internet CDN -->
|
<!-- request js from internet CDN -->
|
||||||
<!-- <script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> -->
|
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
|
||||||
<!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> -->
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||||
<!-- <script src="https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.min.js"></script> -->
|
<script src="https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.min.js"></script>
|
||||||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/reconnecting-websocket/1.0.0/reconnecting-websocket.min.js" integrity="sha256-A4JwlcDvqO4JXpvEtvWY1RH8JAEMu5W21wP8GUXLUNs=" crossorigin="anonymous"></script> -->
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/reconnecting-websocket/1.0.0/reconnecting-websocket.min.js" integrity="sha256-A4JwlcDvqO4JXpvEtvWY1RH8JAEMu5W21wP8GUXLUNs=" crossorigin="anonymous"></script>
|
||||||
|
|
||||||
<!-- request js from the ESP8266 web server -->
|
<!-- request js from the ESP8266 web server -->
|
||||||
<script src="js/jquery-3.1.1.min.js"></script>
|
<!-- <script src="js/jquery-3.1.1.min.js"></script> -->
|
||||||
<script src="js/bootstrap.min.js"></script>
|
<!-- <script src="js/bootstrap.min.js"></script> -->
|
||||||
<script src="js/r-websocket.min.js"></script>
|
|
||||||
|
|
||||||
<script src="js/simple.js"></script>
|
<script src="js/simple.js"></script>
|
||||||
|
|
||||||
|
@ -1,95 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<title>ESP8266 + FastLED by Evil Genius Labs</title>
|
|
||||||
|
|
||||||
<!-- request CSS from internet CDN -->
|
|
||||||
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> -->
|
|
||||||
|
|
||||||
<!-- request CSS from the ESP8266 web server -->
|
|
||||||
<link rel="stylesheet" href="css/bootstrap.min.css">
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="css/styles.css">
|
|
||||||
|
|
||||||
<link rel="icon" href="images/atom196.png">
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<nav class="navbar navbar-default navbar-static-top" id="top" role="banner">
|
|
||||||
<div class="container">
|
|
||||||
<div class="navbar-header">
|
|
||||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse-1" aria-expanded="false">
|
|
||||||
<span class="sr-only">Toggle navigation</span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
<span class="icon-bar"></span>
|
|
||||||
</button>
|
|
||||||
<a class="navbar-brand" href="https://www.evilgeniuslabs.org" target="_blank"><img src="/images/atom196.png" style="width: 24px; height: 24px;" /></a>
|
|
||||||
<a class="navbar-brand" href="https://www.evilgeniuslabs.org" target="_blank">Evil Genius Labs</a>
|
|
||||||
</div>
|
|
||||||
<div class="collapse navbar-collapse" id="navbar-collapse-1">
|
|
||||||
<ul class="nav navbar-nav">
|
|
||||||
<li><a href="/">ESP8266 + FastLED <span class="sr-only">(current)</span></a></li>
|
|
||||||
<li><a href="/simple.htm" target="_blank" title="Simple Mode">Simple</a></li>
|
|
||||||
<li><a href="/edit.htm" target="_blank" title="Edit Files">Files</a></li>
|
|
||||||
<li><a href="/update" target="_blank" title="Update Firmware">Firmware</a></li>
|
|
||||||
<li class="active"><a href="/wifi.htm" target="_blank" title="Wi-Fi Settings">Wi-Fi</a></li>
|
|
||||||
</ul>
|
|
||||||
<ul class="nav navbar-nav navbar-right">
|
|
||||||
<li>
|
|
||||||
<a href="https://github.com/jasoncoon/esp8266-fastled-webserver">
|
|
||||||
<img style="height: 16px;" src="/images/github.ico" />
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<div id="container" class="container">
|
|
||||||
|
|
||||||
<form class="form-horizontal" id="form" action="/wifi" method="post">
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="inputSSID" class="col-sm-2 control-label">SSID</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<input type="text" autocorrect="off" autocapitalize="none"
|
|
||||||
class="form-control" id="inputSSID" name="ssid" placeholder="SSID (Wi-Fi network name)">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="inputPassword" class="col-sm-2 control-label">Password</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<input type="password" class="form-control" id="inputPassword" name="password" placeholder="Password">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="col-sm-offset-2 col-sm-10">
|
|
||||||
<button type="submit" class="btn btn-default">Connect</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- request js from internet CDN -->
|
|
||||||
<!-- <script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> -->
|
|
||||||
<!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> -->
|
|
||||||
<!-- <script src="https://unpkg.com/isotope-layout@3/dist/isotope.pkgd.min.js"></script> -->
|
|
||||||
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/reconnecting-websocket/1.0.0/reconnecting-websocket.min.js" integrity="sha256-A4JwlcDvqO4JXpvEtvWY1RH8JAEMu5W21wP8GUXLUNs=" crossorigin="anonymous"></script> -->
|
|
||||||
|
|
||||||
<!-- request js from the ESP8266 web server -->
|
|
||||||
<script src="js/jquery-3.1.1.min.js"></script>
|
|
||||||
<script src="js/bootstrap.min.js"></script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
Before Width: | Height: | Size: 5.1 MiB |
Before Width: | Height: | Size: 5.3 MiB |
Before Width: | Height: | Size: 5.8 MiB |
Before Width: | Height: | Size: 5.7 MiB |
Before Width: | Height: | Size: 6.5 MiB |
Before Width: | Height: | Size: 6.2 MiB |
Before Width: | Height: | Size: 6.0 MiB |
Before Width: | Height: | Size: 6.1 MiB |
Before Width: | Height: | Size: 190 KiB |
Before Width: | Height: | Size: 236 KiB |
Before Width: | Height: | Size: 314 KiB |
Before Width: | Height: | Size: 13 MiB |
Before Width: | Height: | Size: 2.4 MiB |
BIN
ultim8x8-hypercube-projection.png
Normal file
After Width: | Height: | Size: 104 KiB |
BIN
ultim8x8.png
Normal file
After Width: | Height: | Size: 45 KiB |