Thread: printf problem
View Single Post
  #4   Spotlight this post!  
Unread 29-01-2005, 19:06
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 750
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: printf problem

Ok so I am having the SAME problem. I can't see if my float calculations are working or not. Did you see the README in the IFI released camera code:

Code:
www.InnovationFirst.com

1/8/2004
-   Removed printf_lib.c and printf_lib.h - now using <stdio.h>, compiler needs -nw=2066 to suppress warnings
-   Added user_camera.c and user_camera.h - to remove code from build -> remove the _USE_CMU_CAMERA macro
-   Replaced file named PicSerialDrv with user_serialdrv
-   Note:  when using a 'printf' use a '\r' rather than a '\n' with the new compiler (v2.4)

So I am not using print_f.lib. I am using stdio.h. I am doing the same thing as
miketwalker but I don't get anything to the screen while trying to use floats.

Has anyone else got any input? I am using MPLAB, not CBOT, and the new 2.4 version complier....

I spent all day wondering if our float calculations are actually working.

Is float supported in this PIC?

Can I even do a calculation like this?

If WHEELBASE = 485.35 mm?

Code:
pos_mm_theta = (pos_mm_Left_Encoder_Count - pos_mm_Right_Encoder_Count)/WHEELBASE;
posx_mm = pos_mm_distance * sin(pos_mm_theta);
posy_mm = pos_mm_distance * cos(pos_mm_theta);



Quote:
Originally Posted by Astronouth7303
If you're using the new compiler, I believe the printf() included in that works with floats (check the documentation in .\mcc18\doc).
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369