2020-03-16 01:50 AM
How to use the timer to keep our LED on 80% to 10% (linear down) of the time by setting a period of 500X, turning it on when the counter is 0 to 400X (0-15 minutes) and turning it off when it is 400X to 500X(5 minutes)?
The time and period is a draft idea.
2020-03-16 02:07 AM
By reading the reference manual on timer output PWM mode.
2020-03-16 03:21 AM
I have some difficulty interpreting your question, so please tell me first if my understanging is correct.
2020-03-16 04:11 AM
Your eyes have a logarithmic response, so you'll need to use an exponential to make the change look linear. Could be a simple lookup table or maybe use the arm math linear interpolation function.
2020-03-16 05:09 AM
Using a 2 kB table (1024 short values) is good for 16384 steps with some bit shifting. Works well even on the STM32F0.