CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

get_float_usb problem

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jaimechacoff



Joined: 14 Feb 2010
Posts: 24
Location: Santiago, Chile

View user's profile Send private message

get_float_usb problem
PostPosted: Wed Feb 24, 2010 3:01 pm     Reply with quote

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
jaimechacoff



Joined: 14 Feb 2010
Posts: 24
Location: Santiago, Chile

View user's profile Send private message

SOLVED!!!
PostPosted: Wed Feb 24, 2010 3:04 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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