View Single Post
  #2   Spotlight this post!  
Unread 02-02-2007, 12:40
eugenebrooks eugenebrooks is offline
Team Role: Engineer
AKA: Dr. Brooks
no team (WRRF)
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Livermore, CA
Posts: 601
eugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond repute
Re: printing FLOAT data type on the terminal window

Quote:
Originally Posted by razer View Post
I have a question -
can i print float variable on the terminal window?
for example:

------------------------------------
float a=2.555;
a*=4.5;
printf("a = %f", a);
------------------------------------

does the RC prints float vriables on the IFILoader's Terminal Window?
Last I checked, the printf in PIC support we use did not support floats. Floats, and doubles, are in general a bad idea on this processor. I reccomend fixed point, or aritimetic using rational numbers. See http://srvhsrobotics.org/eugenebrooks/IntroCProg.pdf There is a routine described in this document, and available for download, that prints fixed point numbers.

Eugene