I have a keyboard that has both buttons to scan, and LED’s to light. No issues with the keyboard scan, that is working OK,
There are 20 LED’s, but at most only 6 would be ON at any time. I’m presently using a timer at a rate of 15ms to avoid flicker, but as the number of LED’s ON approaches 6, the flicker is more apparent.
Hoping to get some advice on what the best way to do this. My control loop is set to “PWM” the on time such that it doesn’t exceed the maximum power for the LED. In that loop, which is within the call of the timer task, I am using vTaskDelay(x) where x is the time it’s on before I switch of that LED in the double indexed for loop. Presently, that’s set to 5ms
It seems that if I had 6 LED’s set to be ON, and the delay time ON of each is 5ms, and that total delay is 30ms, which is longer than the timer task rate of 15ms. Is this correct, and if so, how can that be? If this sin’t the best way to do it, can someone please provide an outline of a better method that would provide better light uniformity (ideally, less flicker)
Thanks for your help !