@@ -21,18 +21,21 @@ muss; <i>relaxen und watchen das blinkenlichten.</i>
21
21
22
22
- On / off / toggle
23
23
- 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)
25
25
- Single flashes and pauses, resuming the previous mode
26
26
27
27
Other goodies:
28
28
29
- - Supports active low (inverted) logic
30
29
- Completely non-blocking (no ` delay() ` )
31
- - Parameters for pause- / off- / on-time duration can be adjusted on the fly
32
30
- Super-nice fading effects (optional) with logarithmic brightness compensation for LEDs
33
31
- Lightweight
32
+ - All parameters can be adjusted on the fly without visual hickups
34
33
- Easily extendable to control components via SPI / CAN / I2C / UART ...
35
34
- 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
36
39
37
40
## Example
38
41
@@ -77,15 +80,15 @@ pio lib install "tfeldmann/Blinkenlight"
77
80
```C
78
81
// Without fading effect:
79
82
#include <Blinkenlight.h>
80
- Blinkenlight myPin (13);
83
+ Blinkenlight myLed (13);
81
84
82
85
// With fading effect:
83
86
#include <Fadinglight.h>
84
- Fadinglight myPin (13);
87
+ Fadinglight myLed (13);
85
88
86
89
// now in your code you can do:
87
- myPin.permanent(LOW );
88
- myPin .blink();
90
+ myLed.off( );
91
+ myLed .blink();
89
92
// ... and so on (see below)
90
93
91
94
// options available in the constructor:
@@ -179,6 +182,13 @@ myLed.settings.on_ms = 250;
179
182
myLed.settings.pause_ms = 2000;
180
183
```
181
184
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
+
182
192
## I have a status indicator controlled via CAN / I2C / SPI / ... What can I do?
183
193
184
194
No problem! You have two options.
0 commit comments