This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generate lookup table for converting between perceived LED brightness and PWM | |
// Adapted from: https://jared.geek.nz/2013/feb/linear-led-pwm | |
// See also: https://ledshield.wordpress.com/2012/11/13/led-brightness-to-your-eye-gamma-correction-no/ | |
#include <iostream> | |
#include <cmath> | |
#include <iomanip> | |
constexpr int TABLE_SIZE = 256; // Number of steps (brightness) |