Comments (12)
Ill have a dig into this, haven't seen it happen but will try to recreate.
from super-simple-rgb-wifi-lamp.
It only happens when turning the lamp off. When switching modes, it fades to black and then comes on again with the right mode.
I put a little video online : https://drive.google.com/file/d/11H5b7lDtVfai7jVCG0KzLAqhSe5cue0E/view?usp=sharing
PS: be sure to download the video, when I play it in my browser it's barely visible.
from super-simple-rgb-wifi-lamp.
Had to watch it a few times but i think i see what you mean (very evident when downloaded though). Might be an issue with wrap around in my code or fast LED. If you haven't, make sure you are up to date with the libraries in the meantime.
Awesome to see someone build it though.
from super-simple-rgb-wifi-lamp.
be sure to download the video, when I play it in my browser it's barely visible.
It's a great little project. I would love to see something like a fire mode ....
from super-simple-rgb-wifi-lamp.
I just noticed its not just when fading to black, it also happens when the lights are a full brightness. But then it's not that visible, because it switches directly back to full brightness.
New video uploaded, again you have to download it to really see it.... around second 2
https://drive.google.com/open?id=13ciJeC-3PrgpXlDLq5uSqk3twDCW0LJo
from super-simple-rgb-wifi-lamp.
New observation.... only happens with certain fade time... It does happen with 500, 1400, 1500, 1800 and 1900 but not with 0, 100, 200, 300, 400, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1500, 1600, 1700, 2000
from super-simple-rgb-wifi-lamp.
Awesome. Thanks for the updates. It does seem to happen for those numbers, just tested it then. I'll dig into the code as soon as I can and see where there is an error.
from super-simple-rgb-wifi-lamp.
I added some debugging to the code, and noticed that modeChangeFadeAmount got below 0 for those certain Fadetimes. Adding a constrain seems to stop the behavior for me.
if (modeChangeFadeAmount > 0) {
EVERY_N_MILLISECONDS(20) {
modeChangeFadeAmount -= (FadeTime > 0) ? (255 / ((float)FadeTime/20)) : 255;
modeChangeFadeAmount = constrain(modeChangeFadeAmount,0,255);
Serial.print("[handleMode] - modeChaneFadeAmount : ");
Serial.println(modeChangeFadeAmount);
};
I added a constrain in all places where you change the modeChangeFadeAmount.
from super-simple-rgb-wifi-lamp.
Looking a bit further, I found you have an "else" laying around before your constrain in the code. (LEDS.ino) commenting this one out, also fixes the issue....
else
// Globally Scale the brightness of all LED's
modeChangeFadeAmount = constrain(modeChangeFadeAmount, 0, 255);
nscale8(ledString, NUM_LEDS, (int)modeChangeFadeAmount);
from super-simple-rgb-wifi-lamp.
Found all of the above. Seemed to be summing one last time using the inbuilt fastLED function EVERY_N_MILLISECONDS for those times you stated.
Ended up just shuffling a few things around and now the integer does not overflow. Test and worked in the latest pull for myself, let me know if you have issues.
from super-simple-rgb-wifi-lamp.
Working for me.
from super-simple-rgb-wifi-lamp.
Perfect, closing issue
from super-simple-rgb-wifi-lamp.
Related Issues (19)
- Super-Simple-RGB-WiFi-Lamp (Clock, Night rider and Bell curve error) HOT 3
- Error in compiling HOT 3
- Switching between config pages allways turns on the Lamp HOT 3
- OTA HOT 3
- OTA not working most of the time HOT 6
- Suggestion HOT 7
- Unable to compile the sketch HOT 3
- Question: Web page implementation HOT 2
- Feature Request: Create global brightness slider in UI HOT 7
- No web interface HOT 7
- Feature Request: Encapsulate settings / config in extra file HOT 4
- Flickering LEDs + Possible solution HOT 10
- Library Development Discussion
- Add support for Amazon Alexa HOT 4
- Webpage not loading format or responding to light strip interaction HOT 4
- Miss spelling in web page HOT 1
- SaturationFade error HOT 1
- Problem: SSID and Password is not permanent HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from super-simple-rgb-wifi-lamp.