Hi, Chris
A servomotor has it's own signal limitations ...
from 800 to 2200 µs pulse ( STD ) ... so unpredictable behaviour can occur outside those limits ...
Code:
ADCIN 0, B2 ' Reads in the PORT A.0 ADC AND STORES THE VALUE IN B2
ADCIN 1, B3 ' READS IN THE PORT a.1 ADC AND STORES THE VALUE IN B3
XPRESET = B2 + 50
your accelerometer is an analog one, Ok ... but ADCIN can give a result between 0 and 256 ...
so, the servo signal range is not guaranteed to be in the " valid" range.
Now , you read Twice the accelerometer in one cycle ... not really a problem, but it's not compulsory here.
BTW ... Which Pic and Accelerometer do you use ???
Alain
Last edited by Acetronics2; - 28th February 2009 at 12:43.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks