jandelgado / jled

Non-blocking LED controlling library for Arduino and friends.
MIT License
324 stars 51 forks source link

Return pin's previous state after Blink is over #120

Closed peros550 closed 7 months ago

peros550 commented 11 months ago

Hi

Would it be possible to return the pin to its previous state after Blink function finishes ?

Thanks,

jandelgado commented 10 months ago

You could do something like

#include <jled.h>

auto led = JLed(LED_BUILTIN).Blink(1000, 1000).Repeat(5);

void setup() {
}

void loop() {
  if (!led.Update()) {
    led.Off().Update();   // or whatever you want 
  }

}

Update() only returns true as long as the effect is still active.

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days