Thread: Rookie help
View Single Post
  #12   Spotlight this post!  
Unread 20-12-2004, 16:17
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,830
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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