FadeLed
A simple Arduino library to fade leds on hardware PWM
|
A simple Arduino library to fade LEDs on the hardware PWM. More...
#include "Arduino.h"
#include <avr/pgmspace.h>
#include "FadeLedGamma.h"
Go to the source code of this file.
Classes | |
class | FadeLed |
Main class of the FadeLed-library. More... | |
Macros | |
#define | FADE_LED_PWM_BITS 8 |
Sets the number of bits used for the PWM. More... | |
#define | FADE_LED_MAX_LED 6 |
Maximum number of FadeLed objects. More... | |
#define | FADE_LED_RESOLUTION ((1 <<FADE_LED_PWM_BITS) -1) |
The maximum brightness step of the PWM. More... | |
Typedefs | |
typedef uint8_t | flvar_t |
Sets the variable type used for the brightness. More... | |
A simple Arduino library to fade LEDs on the hardware PWM.
This library takes all the heavy lifting of fading a LED.
#define FADE_LED_MAX_LED 6 |
Maximum number of FadeLed objects.
Default = 6, the number of hardware PWM pins on an Uno/Pro Mini/Nano
#define FADE_LED_PWM_BITS 8 |
Sets the number of bits used for the PWM.
Set this to a higher value for devices with higher PWM resolution. Will set the upper limit and variable type correspondingly.
Default 8-bit: 0-255 for Uno/Nano/Pro Mini etc
#define FADE_LED_RESOLUTION ((1 <<FADE_LED_PWM_BITS) -1) |
The maximum brightness step of the PWM.
Automatically set depending on FADE_LED_PWM_BITS. 255 for 8-bit.
typedef uint8_t flvar_t |
Sets the variable type used for the brightness.
Is done automatically according to FADE_LED_PWM_BITS. A byte (uint8_t) is used for 8-bit or less. An unsigned int (uint16_t) is used for anything above. So limited to 16-bit PWM.