1. I used 32 pulse width values instead of 16. And so the look-up table for this demo is:
const char PW[] = {0, 0, 1, 1, 1, 2, 2, 3, 4, 5, 6, 7, 9, 10, 12, 15, 18, 22, 26, 31, 37, 44, 53, 63, 75, 90, 107, 127, 151, 180, 214, 255};
2. To preserve the 655ms total time from zero to maximum brightness I halved the timer2 postscale to 1:5.
3. Because of the increase in PW values, the constant in one of the conditional statements had to be changed from 15 to 31:
if (direction && ++i > 31)
.
No comments:
Post a Comment