|
Re: Rookie help
Quote:
|
Originally Posted by doyler
And I just use MPLAB IDE to mess with it
Also, what kind of code am i looking for just to make these things move for starters
|
Yes, learn to use MPLAB.
How about putting something like this where it says " /* Add your own code here. */" in the file "user_routines.c" in the routine "Process_Data_From_Master_uP"
Code:
static unsigned char servo1=0; //Put these two lines right before the "Getdata" call
static unsigned char counter=0; // ditto
//Put these lines after "Add your own code"
if (counter < 20) // about half a second in the slow loop
counter++;
else
{
counter = 0;
if (servo1 < 255)
servo1++; // servo1 will slowly step through each of it’s positions
else
servo1 = 0; // servo1 will quickly reset to the zero position
}
pwm03 = servo1;
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Last edited by Mark McLeod : 21-12-2004 at 15:03.
Reason: explicit type unsigned
|