Hey all, I'm a newbie with a newbie question.
I'm trying to find out how to write to timer1(16bit) with a decimal variable that constantly changes. I can't input it manually because it's always different.
From looking through the datasheet it seems I need to write to both the high and low 'pair' with half the 16 bit value going to each, ie. tmr1H = 255, tmr1L = 255. I don't know how to do this automaticly from a value such as 34657, and I don't know ASM.
Here's an attempt at some code:
IF SERVO1 = 1 THEN
TMR1 = (65535 - TMROFF)
LOW SERVO1
ENDIF
This obviously didn't work.
I'm trying to control a servo, and I need to be able to vary the angle constantly.
I tried using Darryl Taylors servo include, but a.) I couldn't get it to work, and b.) I need to run two servos at once and half of his program is in ASM so I can't modify it.
Thanks for any help.
Bookmarks