Skip to content

Commit d83a4ad

Browse files
committed
update readme
1 parent d72df55 commit d83a4ad

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,21 @@ muss; <i>relaxen und watchen das blinkenlichten.</i>
2121

2222
- On / off / toggle
2323
- Infinite blinking
24-
- Blink patterns in the style of "Blink x times, pause, blink y times, repeat"
24+
- Blink patterns (for example to blink an error code)
2525
- Single flashes and pauses, resuming the previous mode
2626

2727
Other goodies:
2828

29-
- Supports active low (inverted) logic
3029
- Completely non-blocking (no `delay()`)
31-
- Parameters for pause- / off- / on-time duration can be adjusted on the fly
3230
- Super-nice fading effects (optional) with logarithmic brightness compensation for LEDs
3331
- Lightweight
32+
- All parameters can be adjusted on the fly without visual hickups
3433
- Easily extendable to control components via SPI / CAN / I2C / UART ...
3534
- Comes with good-looking defaults (at least I tried)
35+
- Tries to be user friendly (for example calling `blink()` while blinking does not
36+
restart the cycle)
37+
- Supports active low (inverted) logic
38+
- Can be used for buzzers as well
3639

3740
## Example
3841

@@ -77,15 +80,15 @@ pio lib install "tfeldmann/Blinkenlight"
7780
```C
7881
// Without fading effect:
7982
#include <Blinkenlight.h>
80-
Blinkenlight myPin(13);
83+
Blinkenlight myLed(13);
8184
8285
// With fading effect:
8386
#include <Fadinglight.h>
84-
Fadinglight myPin(13);
87+
Fadinglight myLed(13);
8588
8689
// now in your code you can do:
87-
myPin.permanent(LOW);
88-
myPin.blink();
90+
myLed.off();
91+
myLed.blink();
8992
// ... and so on (see below)
9093
9194
// options available in the constructor:
@@ -179,6 +182,13 @@ myLed.settings.on_ms = 250;
179182
myLed.settings.pause_ms = 2000;
180183
```
181184

185+
## Fading effect and brightness compensation
186+
187+
LED brightness is not linear to the PWM value you set to the pin.
188+
This library uses a logarithmic dimming curve to create natural looking fading effects.
189+
190+
![logarithmic fading](docs/logarithmic.png)
191+
182192
## I have a status indicator controlled via CAN / I2C / SPI / ... What can I do?
183193

184194
No problem! You have two options.

docs/logarithmic.png

60.2 KB
Loading

0 commit comments

Comments
 (0)