![]() |
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 ) ;I thought that "%ld" was the correct value to put in for a long? What am I doing wrong? Thanks, Nathan |
Re: PrintToScreen() function prints out hex values?
Quote:
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 |
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 |
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. |
| All times are GMT -5. The time now is 23:17. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi