View Full Version : Print F statement
brownster
18-02-2005, 19:20
I can't seem to get my printf statements to work in Kevins nav code..heres what i have so far
printf("Port1 Y %3d, X %3d, DIGITAL %d, DIGITAL %d, Wheel %3d, p1_aux1 %d, p1_aux2 %d, pwm09 %3d\r",(int)p1_y,(int)p1_x,(int)digital_io_02,(int)digit al_io_02,(int)p1_wheel,(int)p1_sw_aux1,(int)p1_sw_ aux2,(int)pwm09);
THis is the error that it gives me when i try to build
C:\ROBOTICS\TEST CODE\FrcCode\user_routines.c:494:Warning [2066] type qualifier mismatch in assignment
HELP!
One problem with your code it that you are using digital_io_02. That is used for initialization, not for reading/sending data. You should use 'rc_dig_in02' for inputting the data, and I am not sure why you are printing it twice, but thats not a code problem.
brownster
18-02-2005, 22:45
One problem with your code it that you are using digital_io_02. That is used for initialization, not for reading/sending data. You should use 'rc_dig_in02' for inputting the data, and I am not sure why you are printing it twice, but thats not a code problem.
ok i changed that part and it still gives me that error..any ideas?
ok i changed that part and it still gives me that error..any ideas?Hmmm... it may have to do with the fact that you are converting a bit to an int,
Or less likely that you are converting the unsigned chars to ints.
Mark McLeod
19-02-2005, 00:05
C:\ROBOTICS\TEST CODE\FrcCode\user_routines.c:494:Warning [2066] type qualifier mismatch in assignment
That's not a problem. It's a known "feature" of the new compiler.
See the README.txt in the v2.4 project directory.
You can suppress this particular error by adding
-nw=2066
in MPLAB -> Project -> Build Options... -> Project
on the MPLAB C18 tab, click on Use Alternate Settings and add it to the end.
brownster
20-02-2005, 01:29
That's not a problem. It's a known "feature" of the new compiler.
See the README.txt in the v2.4 project directory.
You can suppress this particular error by adding
-nw=2066
in MPLAB -> Project -> Build Options... -> Project
on the MPLAB C18 tab, click on Use Alternate Settings and add it to the end.
Thnx..that surpressed it..but the printf wonts work..how can they work?
Mark McLeod
20-02-2005, 01:35
Thnx..that surpressed it..but the printf wonts work..how can they work?The new printf requires the addition of
#include <stdio.h>
at the top of any file that uses it. Otherwise, you won't see anything.
The new printf requires the addition of
#include <stdio.h>
at the top of any file that uses it. Otherwise, you won't see anything.
I realllllly wish that would throw an error. We thought our drive code wasnt executing for almost 2 days because the PrintF wasnt being called.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.