I am using the TimerOne class to create PWM control for 8 servos. I'm not using the build in PWM function because that is not suitable for 8 servo's. In stead I have an array with pulse lengths and after each timer interrupt I need another interrupt with the new time as found in the array.
I thought using the Timer1 class woudl do the trick because I could just call Timer1.setPeriod after each interrupt to set the new interval time but whatever I try, as soon as I call Timer1.setPeriod the timer stops. First I thought this might be because I was setting the new time from the callback function and maybe that was a bad thing. But apparently even calling setPeriod from the loop or setup function will stop the timer. I've tried getting the timer running again with Timer1.start (and with calling Timer1.stop before changing the interval time), Timer1.initialize.
Whatever I try I can't keep the timer running when I change the interval time. Can someone help me out please?