- new:
JLed::MaxBrightness(uint8_t level)
method to limit output of effects (implements #43).
- JLed now supports the mbed framework. See README.md and
examples/multiled_mbed
for examples.
- new example: custom HAL showing how to implment a custom HAL.
- fix: make sure memory alignment is correct (caused hard fault on SAMD21). Fixes #27.
- changing an effect resets the Jled object so it starts over with the
new effect (see #25). Prior to this change, calling
Reset()
was necessary.
- fix: ESP32 dynamic channel assignment fixed. Sequence demo now working as expected (see #22).
- fix: version format in library.properties (removed leading
v
; see #21)
- change: clean up interface and simplify code:
On()
no longer takes an optional brightness argument. CallSet(uint8_t brightness)
instead. - documentation update
In addition to the changes introduced with v4.0.0-rc0
and v4.0.0-rc1
, the
v4.0.0
relases adds/changes the following:
- new
Candle()
effect added for candles and fire like effects
- The user provided brightness class no longer needs a
Clone()
method. See example for an example
- Makefile (unit testing) dependency checking fixed
- fix: byte buffer alignment for ESP8266 set to DWORD boundary making ESP8266 run again with JLed 4.x
- arduino HAL now does lazy call to pinMode() to prevent STM32 problems
- simplified morse example code
JLed::Reset()
- resets the led to it's initial state allowing to to start overJLed::IsRunning()
- return true if effect is active, else false- new class
JLedSequence
to update JLed objects simultanously or sequentially. See README for details. - added new morse example
- clean separation between hardware specific and common code, making extendability easy
- added STM32 example to platformio.ini
- the brightness user function pointer was replaced by an object of type BrightnessEvaluator. Migration of code should be straight forward, see below
In JLed version prio to version 4.0.0, a function pointer was used to specify a user provided brightness function.
// this function returns changes between 0 and 255 and vice versa every 250 ms.
uint8_t blinkFunc(uint32_t t, uint16_t, uintptr_t) {
return 255*((t/250)%2);
}
// Run blinkUserFunc for 5000ms
JLed led = JLed(LED_BUILTIN).UserFunc(blinkFunc, 5000);
The user function is replaced by a class, which provides more flexibility:
class UserEffect : public jled::BrightnessEvaluator {
uint8_t Eval(uint32_t t) const {
// this function returns changes between 0 and 255 and
// vice versa every 250 ms.
return 255*((t/250)%2);
}
uint16_t Period() const { return 5000; }
};
UserEffect userEffect;
JLed led = JLed(LED_BUILTIN).UserFunc(&userEffect);
JLed::Invert()
method was removed since became redundant with LowActive()
- Major refactoring making support of different platforms easier
- ESP32 support added
- Unit tests refactored
JLed::Update()
now returns abool
indicating if the effect is still active (true), or finished (false).
- ESP8266 platform: scaling from 8 to 10 bit improved. The scaling makes sure that 0 is mapped to 0 and 255 is mapped to 1023, preserving min/max relationships in both ranges.
- ESP8266 platform: analogWrite() resoultion of 10 bit is now honoured. Previously only a range of 0..255 was used, which resulted in output being dimmed.
- It's never to late for a changelog ;)
- ESP8266 environment added to platform.ini