FadeLed
A simple Arduino library to fade leds on hardware PWM
SineFade.ino File Reference

Example how to use FadeLed library with custom gamma table. More...

#include <FadeLed.h>

Functions

void setup ()
 
void loop ()
 
bool allOff ()
 

Variables

const flvar_t SineTable [91] PROGMEM
 
FadeLed sines [3] = {{9, SineTable, 90}, {10, SineTable, 90}, {11, SineTable, 90}}
 
const byte NrSines = sizeof(sines)/sizeof(sines[0])
 

Detailed Description

Example how to use FadeLed library with custom gamma table.

Septillion (https://github.com/sseptillion)

Date
2018-04-27

This is an example how to use FadeLed library with custom gamma table. In this example it even uses a sinusoidal table. You're completely free how the graph should look like, simply define a value for each step.

The sine table is made with the included Python script 'makeSineTable.py' in the folder of this example. Running that will give 91 values (0 to 90 degree) to form a sine.

The pastern that is followed by pins 9, 10 and 11 is shown in 'sines.png'

sines.png

Variable Documentation

◆ PROGMEM

const flvar_t SineTable [91] PROGMEM
Initial value:
= {
0, 4, 9, 13, 18, 22, 27, 31, 35, 40,
44, 49, 53, 57, 62, 66, 70, 75, 79, 83,
87, 91, 96, 100, 104, 108, 112, 116, 120, 124,
127, 131, 135, 139, 143, 146, 150, 153, 157, 160,
164, 167, 171, 174, 177, 180, 183, 186, 190, 192,
195, 198, 201, 204, 206, 209, 211, 214, 216, 219,
221, 223, 225, 227, 229, 231, 233, 235, 236, 238,
240, 241, 243, 244, 245, 246, 247, 248, 249, 250,
251, 252, 253, 253, 254, 254, 254, 255, 255, 255,
255}