Skip to content

Commit

Permalink
Full release of v0.6.0
Browse files Browse the repository at this point in the history
Added transitionDelay from notification used for smoother sync
Fixed random color too dim
  • Loading branch information
Aircoookie committed Mar 15, 2018
1 parent 89afdd2 commit d09a97f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions wled00/data/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 46,7 @@
if (this.readyState == 4) {
if (this.status == 200) {
if (this.responseXML != null) {
d.Cf.SA.value = this.responseXML.getElementsByTagName('act')[0].childNodes[0].nodeValue;
d.Cf.SA.value = this.responseXML.getElementsByTagName('ac')[0].childNodes[0].nodeValue;
d.Cf.SR.value = this.responseXML.getElementsByTagName('cl')[0].childNodes[0].nodeValue;
d.Cf.SG.value = this.responseXML.getElementsByTagName('cl')[1].childNodes[0].nodeValue;
d.Cf.SB.value = this.responseXML.getElementsByTagName('cl')[2].childNodes[0].nodeValue;
Expand All @@ -69,7 69,7 @@
nState = 0;
nState = (this.responseXML.getElementsByTagName('nr')[0].innerHTML)!=0?1:0;
nState = (this.responseXML.getElementsByTagName('ns')[0].innerHTML)!=0?2:0;
d.getElementsByClassName("desc")[0].innerHTML = this.responseXML.getElementsByTagName('desc')[0].innerHTML;
d.getElementsByClassName("desc")[0].innerHTML = this.responseXML.getElementsByTagName('ds')[0].innerHTML;
UV();
}
}
Expand Down
3 changes: 2 additions & 1 deletion wled00/wled00.ino
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 33,7 @@
#include "WS2812FX.h"

//version in format yymmddb (b = daily build)
#define VERSION 1803146
#define VERSION 1803151
const String versionString = "0.6.0";

//AP and OTA default passwords (change them!)
Expand Down Expand Up @@ -141,6 141,7 @@ byte colSecIT[]{0, 0, 0};
byte white, whiteOld, whiteT, whiteIT;
byte whiteSec, whiteSecIT;
byte lastRandomIndex = 0;
uint16_t transitionDelayTemp = transitionDelay;
unsigned long transitionStartTime;
unsigned long nightlightStartTime;
float tperLast = 0;
Expand Down
14 changes: 4 additions & 10 deletions wled00/wled03_set.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 2,15 @@
* Receives client input
*/

void _setRandomColor(bool _sec)
void _setRandomColor(bool _sec,bool fromButton=false)
{
lastRandomIndex = strip.get_random_wheel_index(lastRandomIndex);
uint32_t _color = strip.color_wheel(lastRandomIndex);
if (_sec){
whiteSec = ((_color >> 24) & 0xFF);
colSec[0] = ((_color >> 16) & 0xFF);
colSec[1] = ((_color >> 8) & 0xFF);
colSec[2] = (_color & 0xFF);
colorHStoRGB(lastRandomIndex*256,255,colSec);
} else {
white = ((_color >> 24) & 0xFF);
col[0] = ((_color >> 16) & 0xFF);
col[1] = ((_color >> 8) & 0xFF);
col[2] = (_color & 0xFF);
colorHStoRGB(lastRandomIndex*256,255,col);
}
if (fromButton) colorUpdated(2);
}

void handleSettingsSet(byte subPage)
Expand Down
4 changes: 4 additions & 0 deletions wled00/wled07_notify.ino
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 95,10 @@ void handleNotifications()
effectIntensity = udpIn[16];
strip.setIntensity(effectIntensity);
}
if (udpIn[11] > 3)
{
transitionDelayTemp = ((udpIn[17] << 0) & 0xFF) ((udpIn[18] << 8) & 0xFF00);
}
nightlightActive = udpIn[6];
if (!nightlightActive)
{
Expand Down
7 changes: 5 additions & 2 deletions wled00/wled08_led.ino
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 76,9 @@ void colorUpdated(int callMode)
notify(callMode);
if (fadeTransition || sweepTransition)
{
//set correct delay if not using notification delay
if (callMode != 3) transitionDelayTemp = transitionDelay;

if (transitionActive)
{
colOld[0] = colT[0];
Expand All @@ -97,9 100,9 @@ void colorUpdated(int callMode)

void handleTransitions()
{
if (transitionActive && transitionDelay > 0)
if (transitionActive && transitionDelayTemp > 0)
{
float tper = (millis() - transitionStartTime)/(float)transitionDelay;
float tper = (millis() - transitionStartTime)/(float)transitionDelayTemp;
if (tper >= 1.0)
{
transitionActive = false;
Expand Down
2 changes: 1 addition & 1 deletion wled00/wled09_button.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 20,7 @@ void handleButton()
else if (millis() - buttonPressedTime > 700)
{
if (macroLongPress != 0) {applyMacro(macroLongPress);}
else _setRandomColor(false);
else _setRandomColor(false,true);
}
else {
if (macroButton == 0)
Expand Down

0 comments on commit d09a97f

Please sign in to comment.