View Single Post
  #6   Spotlight this post!  
Unread 29-01-2008, 18:02
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Problem with printf()

Quote:
Originally Posted by Mr. Freeman View Post
Thanks for all of your help, but I'm still having trouble getting this working. I've moved the printf statement to below all the variable declarations. The code compiles fine with no errors or warnings, but the printf still doesn't work.

Our software mentor should be showing up in a few hours, so hopefully he'll be able to help if I can't get it working by then, but I'd like to solve this as soon as possible because it's holding up the testing of our robot.

Here is the code as it looks now. I'm pretty sure there isn't anything wrong with it, but I can't explain the fact that it doesn't work. I'd like to post more relevant sections, but I'm getting 0 errors and 0 warnings.

Code:
void Process_Data_From_Master_uP(void)
{
 
// for debugging
static int counter = 0;
 
    unsigned char byte_count;
    unsigned char data;
    unsigned char j;
 
printf("akjsdfusdhafkjsa");
 
    Getdata(&rxdata);
There is some weirdness with Microchip's implementation of the stdio library that necessitates the use of the return and new line characters at the end of a string. Try this:

printf("akjsdfusdhafkjsa\r\n");

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org