Giter Site home page Giter Site logo

Various questions about jled HOT 2 CLOSED

jandelgado avatar jandelgado commented on May 25, 2024
Various questions

from jled.

Comments (2)

jandelgado avatar jandelgado commented on May 25, 2024

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.

harueg avatar harueg commented on May 25, 2024

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

blink_analogread_Led_ino5.zip

from jled.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.