Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Print F statement (http://www.chiefdelphi.com/forums/showthread.php?t=34937)

brownster 18-02-2005 19:20

Print F statement
 
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 )digital_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!

AIBob 18-02-2005 19:40

Re: Print F statement
 
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

Re: Print F statement
 
Quote:

Originally Posted by AIBob
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?

AIBob 18-02-2005 22:50

Re: Print F statement
 
Quote:

Originally Posted by brownster
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

Re: Print F statement
 
Quote:

Originally Posted by brownster
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

Re: Print F statement
 
Quote:

Originally Posted by Mark McLeod
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

Re: Print F statement
 
Quote:

Originally Posted by brownster
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.

Dested 20-02-2005 01:58

Re: Print F statement
 
Quote:

Originally Posted by Mark McLeod
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.


All times are GMT -5. The time now is 07:23.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi