
C based look up table for a 'breathing LED'. The 'breathing' effect is used to add a more organic feel to LED outputs.
The dataset is not sinusoidal, as the 'breath' is taken in and let out faster than the rest in between breaths. This is based on data sampling of real human breath
The CSV file is the raw values for plotting
The .h header file should be included in a project and the raw uint8_t (0-255) or the breathing_float() macro can be used to get the index in the table. The table is 255 entries as defined by BREATHING_LUT_SIZE.
Example usage:
#include
#include "breathing_LUT.h"
int main(int argc, char ** argv)
{
while(1)
{
for(x=0;x {
example_led_set_int8(breathing_LUT[x]);
// OR
example_led_set_float(breathing_float(x));
}
}
return 0;
}
Sign Up For Full Access
Members gain full access to the Prosource library with dozens of source files for ARM Cortex, ATMega, PIC processors
as well as desktop and embedded Linux systems. Solutions for bootloaders, Buildroot and Yocto targets as well as guided how-tos
on embedded development to gain critical knowledge in new systems and speed development.