View Single Post
  #1   Spotlight this post!  
Unread 10-03-2004, 15:35
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Question Getting Long Data

How do you get a Long (signed or not) from the FRC to you?

I'm currently using printf() in a way so that, basically:
Code:
void printl(long Num)
{
 //Print Bytes
 printf("Long %d %d %d %d\n", (int)(Num>>24)&0xFF, (int)(Num>>16)&0xFF, 
     (int)(Num>>8)&0xFF, (int)Num&0xFF);
 
 //Print Words
   printf("Long %d %d\n", (int)(Num>>16)&0xFFFF, (int)Num&0xFFFF);
}
The problem is that the thing seems to want to increment higher sections to soon. In a pattern.
Code:
...
0 0 0 8
0 0 1 9
...
0 0 1 16
0 1 1 17
...

(or:
Code:
...
0 8
1 9
...
)

The other option is to use 4 user bytes. but we only have 6. well, 4 User + 2 LED + 1 UserCmd.

Can anyone offer suggestions? This little bug really affects results. (bland understatement)