Richard, the MyTimer was left over from the previous code, and was used to scale the timing of the pwm as in the version of PBP there is no floating point maths. For example if the calculation gave the duration as 4.456 seconds, this would be rounded down to 4 seconds, so over the duration it would loose 255 x 0.456 or almost two minutes. In real terms that's not a problem, but the previous author used that to perform its function. Here is the routine
The temperature routine was an example found on the net and works well...Code:' Timer used to scale the PWM pulse MyTimer: Tick_Tmr = Tick_Tmr + 1 if Tick_Tmr >180 then ;179 Tick_Tmr = 0 b_cnt = b_cnt + 1 W_cnt = W_cnt + 1 endif @ INT_RETURN




Bookmarks