Skip to content

Commit da950e5

Browse files
ArndArnd
Arnd
authored and
Arnd
committed
Merge remote-tracking branch 'SmoothLED/main' into main
2 parents b9bf920 + 2d542bd commit da950e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ _Arduino_ library to control any number of LEDs on any available pins using 10-b
66
## Library description
77
The library allows any number of pins, as many as the corresponding Atmel ATMega processor has, to be defined as 10-bit PWM output pins. It supports setting PWM values from 0-1023 (where 0 is "OFF" and 1023 is 100% "ON") on any pin along with calls that automate "fading" - e.g. set the pin to "OFF" and fade to "FULL" linearly over 2 seconds. The details of how to setup the library along with all of the publicly available methods can be found on the [INA wiki pages](https://github.com/Zanduino/SmoothLED/wiki).
88

9-
Robert Heinlein made the expression [TANSTAAFL](https://en.wikipedia.org/wiki/There_ain%27t_no_such_thing_as_a_free_lunch) popular and it certainly applies here - "_There ain't no such thing as a free lunch_". While certain pins support hardware PWM, they are bound to specific TIMER{n} registers. All of the other pins are relegated to being mere digital pins with only "on" or "off" settings. This library uses the ATMega's TIMER1 and creates an interrupt in the background which then takes care of setting the pin to "on" and "off" in the background - quickly enough so that it is effectively a PWM signal. But doing this via interrupts means that CPU cycles are being used and these affect how many CPU cycles are left for the currently active sketch. The more LEDs defined in the library and the higher the defined interrupt rate the less cycles are left over for the sketch. A detailed description of the performance hit incurred with various numbers of LEDs and at different [hertz()](https://github.com/Zanduino/SmoothLED/wiki/hertz()) settings can be found at [CPU Consumption](https://github.com/Zanduino/SmoothLED/wiki/CPU-Consumption)
9+
Fading a LED so that it looks both smooth and linear requires a bit of work, including appling [CIE 1931 Compensation](https://github.com/Zanduino/SmoothLED/wiki/CIE1931-Compensation). This makes a fade look linear end-to-end, but comes at a cost of reserving 2kB of program memory. The link describes how to free up that memory if linear fading is not required.
1010

11-
Fading a LED so that it looks both smooth and linear requires a bit of work, including appling [CIE 1931 Compensation](https://github.com/Zanduino/SmoothLED/wiki/CIE1931-Compensation). This makes a fade look linear end-to-end, but comes at a cost of reserving 2kB of program memory. The link describes how to free up that memory if linear fading is not requied.
11+
Robert Heinlein made the expression [TANSTAAFL](https://en.wikipedia.org/wiki/There_ain%27t_no_such_thing_as_a_free_lunch) popular and it certainly applies here - "_There ain't no such thing as a free lunch_". While certain pins support hardware PWM, they are bound to specific TIMER{n} registers. All of the other pins are relegated to being mere digital pins with only "on" or "off" settings. This library uses the ATMega's TIMER1 and creates an interrupt in the background which then takes care of setting the pin to "on" and "off" in the background - quickly enough so that it is effectively a PWM signal. But doing this via interrupts means that CPU cycles are being used and these affect how many CPU cycles are left for the currently active sketch. The more LEDs defined in the library and the higher the defined interrupt rate the less cycles are left over for the sketch. A detailed description of the performance hit incurred with various numbers of LEDs and at different [hertz()](https://github.com/Zanduino/SmoothLED/wiki/hertz()) settings can be found on [CPU Consumption](https://github.com/Zanduino/SmoothLED/wiki/CPU-Consumption) wiki page.
1212

1313
## Documentation
1414
The documentation has been done using Doxygen and can be found at [doxygen documentation](https://Zanduino.github.io/SmoothLED/html/index.html)

0 commit comments

Comments
 (0)