Skip to content

Commit

Permalink
Merge pull request #27 from Aircoookie/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Aircoookie committed Jun 23, 2018
2 parents 16ce670 + 094bdf0 commit 65a0f60
Show file tree
Hide file tree
Showing 26 changed files with 1,079 additions and 233 deletions.
11 changes: 5 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,28 @@

WLED is a fast and (relatively) secure implementation of an ESP8266/ESP32 webserver to control NeoPixel (WS2812B) LEDs!

### Features: (V0.6.4)
### Features: (V0.7.0)
- RGB, HSB, and brightness sliders
- All new, mobile-friendly web UI!
- Settings page - configuration over network
- Access Point and station mode - automatic failsafe AP
- WS2812FX library integrated for over 50 special effects!
- WS2812FX library integrated for over 50 special effects (+Custom Theater Chase)!
- Secondary color support lets you use even more effect combinations
- Alexa smart home device server (including dimming)
- Beta syncronization to Philips hue lights
- Support for RGBW strips
- 25 user presets! Save your favorite colors and effects and apply them easily! Now supports cycling through them.
- 25 user presets! Save colors and effects and apply them easily! Supports cycling through them.
- HTTP request API for simple integration
- Macro functions to automatically execute API calls
- Nightlight function (gradually dims down)
- Notifier function (multiple ESPs sync color via UDP broadcast)
- Support for power pushbutton
- Custom Theater Chase
- Support for the Adalight serial ambilight protocol!
- Full OTA software update capability (HTTP and ArduinoOTA)
- Password protected OTA page for added security (OTA lock)
- NTP and configurable analog clock function
- Support for the Cronixie Clock kit by Diamex
- Realtime UDP Packet Control (WARLS, DRGB, DRGBW) possible
- Client HTML UI controlled, customizable themes
- Realtime UDP Packet Control (Hyperion, WARLS, DRGB, DRGBW)

### Quick start guide and documentation:

Expand Down
37 changes: 20 additions & 17 deletions wled00/WS2812FX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@

#define CALL_MODE(n) (this->*_mode[n])();

void WS2812FX::init(bool supportWhite, uint16_t countPixels, uint8_t pin) {
begin(supportWhite,countPixels,pin);
void WS2812FX::init(bool supportWhite, uint16_t countPixels, uint8_t pin,bool skipFirst) {
begin(supportWhite,countPixels,pin,skipFirst);
for (int i=0; i < _led_count; i++) _locked[i] = false;
WS2812FX::setBrightness(_brightness);
show();
Expand Down Expand Up @@ -2032,6 +2032,7 @@ void WS2812FX::setPixelColor(uint16_t i, byte r, byte g, byte b, byte w)
if (_reverseMode) i = _led_count - 1 -i;
if (!_cronixieMode)
{
if (_skipFirstMode) {i++;if(i==1)setPixelColorRaw(0,0,0,0,0);}
if (_rgbwMode)
{
bus->SetPixelColor(i, RgbwColor(r,g,b,w));
Expand All @@ -2050,27 +2051,27 @@ void WS2812FX::setPixelColor(uint16_t i, byte r, byte g, byte b, byte w)
byte wCorr = (int)(((double)((_color_sec>>24) & 0xFF))*_cronixieSecMultiplier);
for (int j=o; j< o+19; j++)
{
setPixelColorRaw(j,rCorr,gCorr,bCorr,wCorr);
setPixelColorRaw((_skipFirstMode)?j+1:j,rCorr,gCorr,bCorr,wCorr);
}
} else
{
for (int j=o; j< o+19; j++)
{
setPixelColorRaw(j,0,0,0,0);
setPixelColorRaw((_skipFirstMode)?j+1:j,0,0,0,0);
}
}
switch(_cronixieDigits[i])
{
case 0: setPixelColorRaw(o+5,r,g,b,w); break;
case 1: setPixelColorRaw(o+0,r,g,b,w); break;
case 2: setPixelColorRaw(o+6,r,g,b,w); break;
case 3: setPixelColorRaw(o+1,r,g,b,w); break;
case 4: setPixelColorRaw(o+7,r,g,b,w); break;
case 5: setPixelColorRaw(o+2,r,g,b,w); break;
case 6: setPixelColorRaw(o+8,r,g,b,w); break;
case 7: setPixelColorRaw(o+3,r,g,b,w); break;
case 8: setPixelColorRaw(o+9,r,g,b,w); break;
case 9: setPixelColorRaw(o+4,r,g,b,w); break;
case 0: setPixelColorRaw((_skipFirstMode)?o+6:o+5,r,g,b,w); break;
case 1: setPixelColorRaw((_skipFirstMode)?o+1:o+0,r,g,b,w); break;
case 2: setPixelColorRaw((_skipFirstMode)?o+7:o+6,r,g,b,w); break;
case 3: setPixelColorRaw((_skipFirstMode)?o+2:o+1,r,g,b,w); break;
case 4: setPixelColorRaw((_skipFirstMode)?o+8:o+7,r,g,b,w); break;
case 5: setPixelColorRaw((_skipFirstMode)?o+3:o+2,r,g,b,w); break;
case 6: setPixelColorRaw((_skipFirstMode)?o+9:o+8,r,g,b,w); break;
case 7: setPixelColorRaw((_skipFirstMode)?o+4:o+3,r,g,b,w); break;
case 8: setPixelColorRaw((_skipFirstMode)?o+10:o+9,r,g,b,w); break;
case 9: setPixelColorRaw((_skipFirstMode)?o+5:o+4,r,g,b,w); break;
default: break;
}
}
Expand Down Expand Up @@ -2134,17 +2135,19 @@ void WS2812FX::clear()
bus->ClearTo(RgbColor(0));
}

void WS2812FX::begin(bool supportWhite, uint16_t countPixels, uint8_t pin)
void WS2812FX::begin(bool supportWhite, uint16_t countPixels, uint8_t pin, bool skipFirst)
{
if (supportWhite == _rgbwMode && countPixels == _led_count && _locked != NULL) return;
_rgbwMode = supportWhite;
_skipFirstMode = skipFirst;
_led_count = countPixels;
_cc_i2 = _led_count -1;
if (_skipFirstMode) _led_count++;
uint8_t ty = 1;
if (supportWhite) ty =2;
bus->Begin((NeoPixelType)ty, countPixels, pin);
bus->Begin((NeoPixelType)ty, _led_count, pin);
if (_locked != NULL) delete _locked;
_locked = new bool[countPixels];
_locked = new bool[_led_count];
}

//For some reason min and max are not declared here
Expand Down
6 changes: 4 additions & 2 deletions wled00/WS2812FX.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ class WS2812FX {
_counter_ccStep = 0;
_fastStandard = false;
_reverseMode = false;
_skipFirstMode = false;
_locked = NULL;
_cronixieDigits = new byte[6];
bus = new NeoPixelWrapper();
Expand All @@ -208,7 +209,7 @@ class WS2812FX {
show(void),
setPixelColor(uint16_t i, byte r, byte g, byte b),
setPixelColor(uint16_t i, byte r, byte g, byte b, byte w),
init(bool supportWhite, uint16_t countPixels, uint8_t pin),
init(bool supportWhite, uint16_t countPixels, uint8_t pin, bool skipFirst),
service(void),
start(void),
stop(void),
Expand Down Expand Up @@ -277,7 +278,7 @@ class WS2812FX {
NeoPixelWrapper *bus;

void
begin(bool supportWhite, uint16_t countPixels, uint8_t pin),
begin(bool supportWhite, uint16_t countPixels, uint8_t pin, bool skipFirst),
clear(void),
setPixelColor(uint16_t i, uint32_t c),
setPixelColorRaw(uint16_t i, byte r, byte g, byte b, byte w),
Expand Down Expand Up @@ -348,6 +349,7 @@ class WS2812FX {
bool
_triggered,
_rgbwMode,
_skipFirstMode,
_fastStandard,
_reverseMode,
_cronixieMode,
Expand Down
36 changes: 19 additions & 17 deletions wled00/data/index.htm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
<head><meta charset="utf-8">
<head><meta charset="utf-8"><meta name="theme-color" content="#fff">
<link rel='shortcut icon' type='image/x-icon' href='/favicon.ico'/>
<title>WLED 0.6.4</title>
<title>WLED 0.7.0</title>
<script>
var d=document;
var w=window.getComputedStyle(d.querySelector("html"));
Expand Down Expand Up @@ -33,6 +33,7 @@
aC = w.getPropertyValue("--aCol");
bC = w.getPropertyValue("--bCol");
dC = w.getPropertyValue("--dCol");
d.querySelector("meta[name=theme-color]").setAttribute("content",bC);
CV(0);
setInterval('GIO()', 5000);
GIO();
Expand Down Expand Up @@ -197,6 +198,7 @@
function SwFX(s)
{
var n=Cf.TX.selectedIndex+s;
if (n==-1||n==58) return;
Cf.TX.selectedIndex =n;
if (n < 0) Cf.TX.selectedIndex = 0;
if (n > 57) Cf.TX.selectedIndex = 53;
Expand All @@ -217,21 +219,22 @@
if (d.Cf.FF.value < 1) d.Cf.FF.value = 1;
if (d.Cf.FF.value > 25) d.Cf.FF.value = 25;
}
function PAt()
{
resp+=(d.Cf.BC.checked)?"&PA=1":"&PA=0";
resp+=(d.Cf.CC.checked)?"&PC=1":"&PC=0";
resp+=(d.Cf.FC.checked)?"&PX=1":"&PX=0";
}
function PSIO(sv)
{
PAt();
if(sv)
{
resp+="&PS=";
resp+=d.Cf.FF.value;
} else
{
if (d.Cf.BC.checked&&d.Cf.CC.checked&&d.Cf.FC.checked)
{resp+="&PL=";resp+=d.Cf.FF.value;}
else {
if(d.Cf.BC.checked){resp+="&PA=";resp+=d.Cf.FF.value;}
if(d.Cf.CC.checked){resp+="&PC=";resp+=d.Cf.FF.value;}
if(d.Cf.FC.checked){resp+="&PX=";resp+=d.Cf.FF.value;}
}
resp+="&PL=";resp+=d.Cf.FF.value;
}
GIO();
}
Expand Down Expand Up @@ -337,13 +340,11 @@
}
function uCY()
{
PAt();
resp+=(d.Cf.CY.checked)?"&CY=1":"&CY=0";
resp+="&P1=" + Cf.P1.value;
resp+="&P2=" + Cf.P2.value;
resp+="&PT=" + Cf.PT.value;
if(d.Cf.BC.checked){resp+="&PA";}
if(d.Cf.CC.checked){resp+="&PC";}
if(d.Cf.FC.checked){resp+="&PX";}
GIO();
}
function R()
Expand All @@ -353,11 +354,12 @@
</script>
<style>
:root {
--aCol: #0ac;
--bCol: #124;
--cCol: #334;
--dCol: #288;
--sCol: #FF00FF;
--aCol: #D9B310;
--bCol: #0B3C5D;
--cCol: #1D2731;
--dCol: #328CC1;
--sCol: #000;
--tCol: #328CC1;
--cFn: Verdana;
}
.ctrl_box {
Expand Down
Loading

0 comments on commit 65a0f60

Please sign in to comment.