![]() |
Default Code and printf
Using MPLAB 6.6 and MCC18 2.4; default code FrcCode2005v2.4
I made 2 changes to the project to run using the simulator: 1. I removed macro definition _USE_CMU_CAMERA 2. I added macro definition _SIMULATOR I get the following warnings: user_routines.c:183:Warning [2066] type qualifier mismatch in assignment user_routines.c:266:Warning [2066] type qualifier mismatch in assignment Both are printf statements: ----- Serial_Driver_Initialize(); printf("IFI 2005 User Processor Initialized ...\r"); /* Optional - Print initialization message. */ ----- /* Add your own code here. (a printf will not be displayed when connected to the breaker panel unless a Y cable is used) */ printf("Port1 Y %3d, X %3d, Fire %d, Top %d\r",(int)p1_y,(int)p1_x,(int)p1_sw_trig,(int)p1_ sw_top); /* printf EXAMPLE */ ----- 1. How do I fix the warning? 2. How do I output "Hello World" (or anything) to the output window? The only output I receive when I run the program is: UART-W0006: Receive file has no data or failed to attach when UART receive mode Enabled. UART-W0006: Receive file has no data or failed to attach when UART receive mode Enabled. UART-W0006: Receive file has no data or failed to attach when UART receive mode Enabled. Thanks, David |
Re: Default Code and printf
The warnings can be safely ignored. If you look at the readme that came with that code, it tells you to use a compiler flag to supress them. Just ignore them, or go look at the readme
|
Re: Default Code and printf
Using the MPLAB simulator you won't be able to do printf's. There's no process setup to complete the serial connection required. The printf's will only work from the EDU or FRC.
As Brian said, the note about this warning is in the Readme.txt file in the FrcCode2005v2.4 folder. You can use: -nw=2066 to suppress the printf warnings. In MPLAB go to Project -> Build Options... -> Project then the MPLAB C18 tab click the checkbox for "Use alternate settings" and add it to the line underneath, e.g., -D_FRC_BOARD -nw=2066 |
| All times are GMT -5. The time now is 14:21. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi