Thread: Copy Cat
View Single Post
  #9   Spotlight this post!  
Unread 08-02-2005, 11:06
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
Re: Copy Cat

Quote:
Originally Posted by russell
Hmmm. I just tried to compile it and I got a bunch of errors.....


what does that mean?
It looks like you didn't follow ALL the instructions:
Quote:
Originally Posted by Meandmyself
address and address2 are unsigned shorts defined in user_routines.c and _fast.c respectively.
Try reading the whole post carefully.

FWIW, the lines should probably be something like:
Code:
unsigned short address; // In user_routines.c
	and
unsigned short address2; // In user_routines_fast.c
Actually, since I didn't see anywhere in the code snippets where the address variables are initialized, that should be:
Code:
unsigned short address = 0; // In user_routines.c
	and
unsigned short address2 = 0; // In user_routines_fast.c
And assuming that these variables don't need to be used outside of these modules, I would make them:
Code:
static unsigned short address = 0; // In user_routines.c
	and
static unsigned short address2 = 0; // In user_routines_fast.c
Further, it looks to me like these address variables aren't needed outside of the storemotors and readmotors functions so, IMHO, these variable declarations should be moved inside their respective functions. E.g.:
Code:
void storemotors(void)
{
	static unsigned short address = 0;
	static char lr = 0;

	if (lr==0)			//alternate writing lmotor & rmotor
	etc.
}//end storemotors
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
“Life should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me