Go to Post ....FIRST helped me realize how much i enjoy engineering, so that i NEED to do well in my classes if i want to reach my goals. - the_short1 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-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 14-01-2008, 11:36
Nathan's Avatar
Nathan Nathan is offline
Registered User
FRC #1501 (Team T.H.R.U.S.T.)
Team Role: Alumni
 
Join Date: Sep 2006
Rookie Year: 2007
Location: United States
Posts: 149
Nathan has a spectacular aura aboutNathan has a spectacular aura aboutNathan has a spectacular aura about
PrintToScreen() function prints out hex values?

When I use the PrintToScreen function provided in the WPI library it prints out hexadecimal values, is there any way to make it print in decimal?

This is the code I'm using:
Code:
PrintToScreen ( "%ld\n" , temp ) ;
"temp" is a long.

I thought that "%ld" was the correct value to put in for a long? What am I doing wrong?

Thanks,
Nathan
__________________
Save money with PriceWombat, a shopping comparison and price tracking tool (that I made!).

Check out my hobby electronics business!

My former robotics team: Huntington County 4-H Robotics
  #2   Spotlight this post!  
Unread 14-01-2008, 18:30
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: PrintToScreen() function prints out hex values?

Quote:
Originally Posted by Nathan View Post
When I use the PrintToScreen function provided in the WPI library it prints out hexadecimal values, is there any way to make it print in decimal?

This is the code I'm using:
Code:
PrintToScreen ( "%ld\n" , temp ) ;
"temp" is a long.

I thought that "%ld" was the correct value to put in for a long? What am I doing wrong?

Thanks,
Nathan

Nathan -

I'm at home now and don't have a controller here to test this. But if you use printf instead of PrintToScreen, I'm pretty sure that will work as advertised. I'll try to test it tomorrow sometime when I get to the office to see what's up.

Thanks,
Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
  #3   Spotlight this post!  
Unread 14-01-2008, 22:50
Nathan's Avatar
Nathan Nathan is offline
Registered User
FRC #1501 (Team T.H.R.U.S.T.)
Team Role: Alumni
 
Join Date: Sep 2006
Rookie Year: 2007
Location: United States
Posts: 149
Nathan has a spectacular aura aboutNathan has a spectacular aura aboutNathan has a spectacular aura about
Re: PrintToScreen() function prints out hex values?

Thanks for the reply Brad. Earlier today I was trying this on a Vex controller, and it printed out the hex values.

I was just recently able to try it on the 2008 FRC controller and it does NOT print out the values in hex, but in the correct decimal format.

So I guess it was just the vex controller?

Thanks,
Nathan
__________________
Save money with PriceWombat, a shopping comparison and price tracking tool (that I made!).

Check out my hobby electronics business!

My former robotics team: Huntington County 4-H Robotics
  #4   Spotlight this post!  
Unread 21-01-2008, 03:39
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: PrintToScreen() function prints out hex values?

That's curious. The Vex code is identical to the FRC code, and all it does is call printf.

Here's a thought... Microchip upgraded their library at one point a few years ago and improved the printf support. It may be that you are using an older version of their library with printf on the Vex side.

You could get the source code (included with the C18 install) of the printf function and add it to your Vex project to make that work. But if you were just prototyping on Vex and the real program is working now, it may not matter.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
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
AutoCAD prints? indieFan Inventor 2 29-11-2004 08:00
Sacramento teams...get your poster prints! Eric Reed Regional Competitions 0 31-03-2004 10:26
blue prints/rules? Chris Paulik General Forum 1 04-01-2003 12:26
An effort to get all the blue prints measurment archiver 2001 1 23-06-2002 22:43
Blue Prints archiver 2001 3 23-06-2002 22:33


All times are GMT -5. The time now is 23:17.

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


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