没啥用呀,主要的重点如何弄一个函数接口,传参一定颜色的值,进行呼吸灯。是PWM表,指数曲线?
/* LED亮度等级 PWM表,指数曲线 ,此表使用工程目录下的python脚本index_wave.py生成*/
const uint16_t indexWave[] = {
1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5,
5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10,
11, 12, 12, 13, 14, 15, 17, 18,
19, 20, 22, 23, 25, 27, 29, 31,
33, 36, 38, 41, 44, 47, 51, 54,
58, 63, 67, 72, 77, 83, 89, 95,
102, 110, 117, 126, 135, 145, 156,
167, 179, 192, 206, 221, 237, 254,
272, 292, 313, 336, 361, 387, 415,
445, 477, 512, 512, 477, 445, 415,
387, 361, 336, 313, 292, 272, 254,
237, 221, 206, 192, 179, 167, 156,
145, 135, 126, 117, 110, 102, 95,
89, 83, 77, 72, 67, 63, 58, 54, 51,
47, 44, 41, 38, 36, 33, 31, 29, 27,
25, 23, 22, 20, 19, 18, 17, 15, 14,
13, 12, 12, 11, 10, 9, 9, 8, 8, 7, 7,
6, 6, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3,
3, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1
}; |