Hello!
I'm not a PIC user, but basically an if statement goes against the philosophy of using a
timer. The merit of a timer is precisely that you don't have to control its value, it handles
itself and wakes you up when overflowing.
So basically you have to find a way to set the value with PIC (create a function like this:
MyTimer.SetValue(adcval); Then if you also find a way to start the timer MyTimer.Start();
then the timer will call an interrupt routine when it reaches the previously set value.
NB: there are myriads of ways of using a timer. One shot, timely recurrent, etc... so what
I wrote might greatly vary (if it's recurrent, it will automatically call the ISR without having
to start it every time, etc...
Dora.