Go to Post the political parties should consist of AndyMarkcrats and IFI-icans.... - Josh Hambright [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-10-2004, 02:35 PM
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
An inspired alumnus
AKA: Jamie Bliss
no team (previously 904 (D-cubed) and 1227 (Techno-Gremlins))
Team Role: Alumni
 
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
Send a message via ICQ to Astronouth7303 Send a message via AIM to Astronouth7303 Send a message via MSN to Astronouth7303 Send a message via Yahoo to Astronouth7303
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)
  #2   Spotlight this post!  
Unread 03-10-2004, 03:29 PM
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,351
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: Getting Long Data

Quote:
Originally Posted by Astronouth7303
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:
{snip}
The problem is that the thing seems to want to increment higher sections to soon. In a pattern.
The problem is that you're printing out each byte of the long as a base-10 number. Try using %x instead of %d. That way, you'll get the right numbers out, but they'll be in hex. If you want it in decimal, your best bet is to modify printf_lib.c (specifically the printi function) to accept long arguments.
  #3   Spotlight this post!  
Unread 03-10-2004, 04:08 PM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Itinerant Programmer
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: 7,189
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: Getting Long Data

Quote:
Originally Posted by Astronouth7303
How do you get a Long (signed or not) from the FRC to you?
I just put some routines here http://www.chiefdelphi.com/forums/showthread.php?t=26529 that do this.

You can just call the one routine that prints decimals without changing any of your own printfs.
__________________
"A child of five could understand this. Fetch me a child of five." - Groucho Marx

Last edited by Mark McLeod : 03-10-2004 at 04:13 PM.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Competition Scouting pauluffel Scouting 31 01-08-2003 11:34 PM
Robot Scouting Database archiver 2001 10 06-24-2002 02:00 AM
Limiting PWM in pbasic archiver 2001 4 06-23-2002 11:38 PM
How long should production time be??? archiver 1999 4 06-23-2002 10:16 PM
Possible Configuration to keep things cheap archiver 1999 8 06-23-2002 10:03 PM


All times are GMT -5. The time now is 06:01 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi