View Single Post
  #2   Spotlight this post!  
Unread 31-05-2006, 09:03
gabrielse's Avatar
gabrielse gabrielse is offline
Registered User
FRC #1748 (Lab Rats)
Team Role: Teacher
 
Join Date: Jun 2005
Rookie Year: 2004
Location: Baltimore
Posts: 55
gabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to beholdgabrielse is a splendid one to behold
Re: Using printf() as UserCode in EasyC 2.0

Quote:
Originally Posted by tacman1123
I've add stdio.h to the Include files of my project, but printf("Test: %d", 1); (as a UserCode block) isn't writing to the terminal. What does PrintToScreen() do differently? PrintToScreen is limited to a single variable, and has a "\n" at the end, I'd like to have a bit more control (and just understand the communciation process better).

Do I need to include the printf_lib? If so, can someone explain the steps of integrating the VexCode libraries with the EasyC libraries?

TIA,

Tac
I've had good luck using PrintToScreen as user code when I need to print multiple variables on one line. Use PrintToScreen the same way you would use printf in a user code block, just make sure you typecast your variables. There is no need to include any libraries.

example (type this in as user code):
PrintToScreen("x = %d, y = %d\n", (int)x, (int)y);

Good luck.