Skip to content

Commit

Permalink
Make JLedSequence objects assignable (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
jandelgado committed Mar 29, 2022
1 parent 8380506 commit 9b657ac
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# JLed changelog (github.com/jandelgado/jled)

## [2022-02-24] 4.10.0
## [2022-03-29] 4.11.0

* change: `JLedSequence` objects are now assignable, making switching
effects easier. See https://github.com/jandelgado/jled-example-switch-sequence for an example.

## [2022-03-24] 4.10.0

* new: `On`, `Off` and `Set` now take an optional `duration` value, making
these effects behave like any other in this regard. This allows to add
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ Example sketches are provided in the [examples](examples/) directory.
* [Simple User provided effect](examples/user_func)
* [Morsecode example](examples/morse)
* [Custom HAL example](examples/custom_hal)
* [Dynamically switch sequences](https://github.com/jandelgado/jled-example-switch-sequence)
* [JLed compiled to WASM and running in the browser](https://jandelgado.github.io/jled-wasm)
* [Raspberry Pi Pico Demo](examples/raspi_pico)
* [ESP32 ESP-IDF example](https://github.com/jandelgado/jled-esp-idf-example)
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "JLed",
"version": "4.10.0",
"version": "4.11.0",
"description": "An embedded library to control LEDs",
"license": "MIT",
"frameworks": ["espidf", "arduino", "mbed"],
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=JLed
version=4.10.0
version=4.11.0
author=Jan Delgado <jdelgado[at]gmx.net>
maintainer=Jan Delgado <jdelgado[at]gmx.net>
sentence=An Arduino library to control LEDs
Expand Down
5 changes: 2 additions & 3 deletions src/jled_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,16 +569,15 @@ class TJLedSequence {
bool IsForever() const { return num_repetitions_ == kRepeatForever; }

private:
const eMode mode_;
eMode mode_;
L* leds_;
size_t cur_;
const size_t n_;
size_t n_;
static constexpr uint16_t kRepeatForever = 65535;
uint16_t num_repetitions_ = 1;
uint16_t iteration_ = 0;
bool is_running_ = true;
};

}; // namespace jled

#endif // SRC_JLED_BASE_H_

0 comments on commit 9b657ac

Please sign in to comment.