![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
jaimechacoff
Joined: 14 Feb 2010 Posts: 24 Location: Santiago, Chile
|
get_float_usb problem |
Posted: Wed Feb 24, 2010 3:01 pm |
|
|
Hi,
I have this little program to test how to write strings using USB, I used to use a similar one in RS232, but now, i am trying to change everything for USB.
Ok, my problem is when I compile the error is "function used but not defined", but its defined in the included file usb_cdc.h
the code:
Code: |
#include <18F4550.h>
#fuses HSPLL,NOWDT,NOPROTECT,NOLVP,NODEBUG,USBDIV,PLL5,CPUDIV1,VREGEN
#use delay(clock=48000000)
#include ".\include\usb_cdc.h"
#include <stdlib.h>
float reference=0;
// ==
void get_info(void){
printf(usb_cdc_putc,"\fNumber: ");
reference = get_float_usb();
printf(usb_cdc_putc,"\fNumber: %6.2f",reference);
delay_ms(50);
} // end get_info();
// ==
void main(void){
delay_ms(300);
usb_cdc_init();
usb_init();
while(!usb_cdc_connected()) {}
do {
usb_task();
get_info();
}
while(true);
}
|
I have a PIC18F4550 and version 3.245.
Thanks |
|
![](templates/subSilver/images/spacer.gif) |
jaimechacoff
Joined: 14 Feb 2010 Posts: 24 Location: Santiago, Chile
|
SOLVED!!! |
Posted: Wed Feb 24, 2010 3:04 pm |
|
|
I solved.
the problem is that first i have to include stdlib.h instead of usb_cdc:
Code: |
#include <stdlib.h>
#include ".\include\usb_cdc.h"
|
I didnt know that, I am new in CCS, notwithstanding, I have some experience in PIC.
Thanks. |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|