jandelgado / jled

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

Extend JLedSequence with and ability to suspend it (On/Off). #48

Closed 3dluvr closed 3 years ago

3dluvr commented 4 years ago

Hi,

After looking into the library code, I think I have an idea how a sequence could be suspended. This might be a quick fix, or a dirty hack, not sure - I just know I need it.

Two new methods would be created: .Off() and .On():

.Off() would allocate a new private/protected array ledssaved, and copy the sequence's leds_ into ledssaved. Then it would call leds_[i].Off() to turn them off. Finally, might have to call Update() once the iteration though LEDs is done?

.On() would copy the ledssaved array back into leds_, and free ledssaved. Might need to call Reset() once the copy is done, too?

Unfortunately, I don't have the savviness to do this myself as I'm not familiar with the library and my C++ skills aren't up to snafu either.

github-actions[bot] commented 3 years 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

jandelgado commented 1 year ago

Working on it in #102