Comments (2)
Hi,
What exactly is non-blocking, something similar to multitasking like with freertos ?
It basically means that your sketch/program using JLed
will not be blocked while the effects play. This is achieved by calling the Update
method on the JLed
objects from inside your main loop, like e.g. in void loop() { led.Update(); }
, instead of doing something like e.g.
// blocking example
void loop() {
analogWrite(LED_BUILTIN, 0);
delay(500);
analogWrite(LED_BUILTIN, 255);
delay(500);
}
for a blinking LED, which will block your code in the delay
calls. JLed does not use "multi-tasking" or timers, the client has to make sure that the Update
method is called regulary.
See the [examples]https://github.com/jandelgado/jled/tree/master/examples) for details.
Would it be possible to change the start and end values ( brightness ) on these effects, especially breathe ?
Yes, use the MaxBrightness
method to set the maximum brightness of a LED. It allows to set the maximum level of an effect.
Do you know these flameless candles ?
Yes, use the Candle
effect to simulate candles and fire flickering.
I would like to build something similar, just bigger.
I would have 4 solenoids moving the flame and 5 channels for the LEDs.
I would use a ESP32 to have some kind of remote control : ON / OFF, Brightness, Speed.
Sounds like an interesting project, looking forward to see it in action ;)
from jled.
Hi jandelgado
Thanks for the quick response !
The candle effect is a bit to flickery for my application. I really do like the breathing.
I just need to change the parameters on the fly.
i.e. min. brightness, max. brightness, duration. These values should be ( in limited range ) random generated. The limiting range then is controlled by an external input, preferably over wifi or something similar. ( when time allows )
I added a nice candle effect, which for some unknown reason worked on an UNO.
But I wasn't able to compile it for the ESP32. No idea whether it was multitasking on the UNO.
The code for one LED is from line 75 - 144. It dims between the old and the new brightness value.
I think you do something similar, just with more math. As far as I could decipher from the sources.
Yes... action, it has to be finished in 2 weeks.
Thanks again
Harald
from jled.
Related Issues (20)
- Blink twice HOT 2
- Evolution for non PWM pins HOT 2
- jled to control RGB? HOT 7
- times in millis should be 32bit values HOT 3
- Make fade-resolution choosable HOT 5
- Why is 'MinBrightness' not in red font HOT 2
- CTRL_ANODE HOT 4
- JLedSequence.Stop() not working HOT 1
- 255 value change 4095 how to HOT 2
- Update MaxBrightness Dynamically? HOT 5
- Pulse LED? HOT 6
- User provided functions never get to max `t` HOT 3
- FadeOn and stay on forever HOT 7
- Change effect works in setup() only HOT 4
- can the candle or other examples be ran inside a function
- Candle to turn off after effect. HOT 12
- Multiple HALs HOT 7
- Change PWM base frequency HOT 4
- Question: How to pass to funtion HOT 2
- Minimum brightness HOT 8
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 jled.