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 CCS Technical Support

compiling error

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



Joined: 12 Jan 2013
Posts: 12

View user's profile Send private message

compiling error
PostPosted: Sun Feb 17, 2013 2:51 pm     Reply with quote

dear all,

Please help me, i don't know why this code wouldn't compile.

thanks

#include <16F877A.h>
#device *= 16
#device adc=8
#fuses HS, NOWDT, NOPROTECT, NOLVP, PUT
#fuses NOBROWNOUT, CPD, NODEBUG, NOWRT
#use delay(clock=10MHz)
#use rs232(baud=1200, xmit=PIN_C6, bits=8, parity=N)

#include <lcd.c>

void main()
{
byte s=0;
lcd_init();
lcd_putc("\f");
setup_adc_ports(adc_clock_internal);
setup_adc(AN0);
set_adc_channel(0);
while(true)
{
read_adc(adc_start_only);
while(!adc_done());
s = read_adc(adc_read_only);
lcd_gotoxy(1,1);
printf(lcd_putc, "\fTx Data = %u" s);
putc(s);
delay_ms(100);
}
}


the error given is that:

Undefined Identifier adc_done
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Sun Feb 17, 2013 3:10 pm     Reply with quote

The CCS manual suggests this to achieve what you appear to want:-
Code:
int1 done = adc_done();
while(!done)
{
  done = adc_done();
}

Good idea to learn to use the code button.

Mike
bimba



Joined: 12 Jan 2013
Posts: 12

View user's profile Send private message

PostPosted: Sun Feb 17, 2013 3:52 pm     Reply with quote

Mike Walne wrote:
The CCS manual suggests this to achieve what you appear to want:-
Code:
int1 done = adc_done();
while(!done)
{
  done = adc_done();
}

Good idea to learn to use the code button.

Mike


thanks Mike

on effecting the changes, the new errors are;

A numeric expression must appear here

Unidentified identifier done
W4GNS



Joined: 28 Sep 2010
Posts: 14
Location: Virginia, USA

View user's profile Send private message

PostPosted: Sun Feb 17, 2013 5:07 pm     Reply with quote

Thats odd, neither the OP or the fix by Mike produced errors on my PCWH 4.14
_________________
PCWH 4.14
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Sun Feb 17, 2013 5:31 pm     Reply with quote

It's essential to read the forum guide.

Which compiler version are you using?

Mike
bimba



Joined: 12 Jan 2013
Posts: 12

View user's profile Send private message

PostPosted: Mon Feb 18, 2013 4:28 am     Reply with quote

Mike Walne wrote:
It's essential to read the forum guide.

Which compiler version are you using?

Mike


i use version 4.032

thanks
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Mon Feb 18, 2013 7:23 am     Reply with quote

I don't have your compiler version.

However, you were told in response to your previous thread, that v4.032 is at best considered a beta version.

Others have tried your code and report no errors.

So, you need to either re-install your compiler or upgrade.

Mike
bimba



Joined: 12 Jan 2013
Posts: 12

View user's profile Send private message

PostPosted: Tue Feb 19, 2013 6:46 am     Reply with quote

Mike Walne wrote:
I don't have your compiler version.

However, you were told in response to your previous thread, that v4.032 is at best considered a beta version.

Others have tried your code and report no errors.

So, you need to either re-install your compiler or upgrade.

Mike


thanks, i just installed version 4.104, and it works fine.

regards to all for your response.
bimba



Joined: 12 Jan 2013
Posts: 12

View user's profile Send private message

PostPosted: Tue Feb 19, 2013 9:37 am     Reply with quote

bimba wrote:
Mike Walne wrote:
I don't have your compiler version.

However, you were told in response to your previous thread, that v4.032 is at best considered a beta version.

Others have tried your code and report no errors.

So, you need to either re-install your compiler or upgrade.

Mike


thanks, i just installed version 4.104, and it works fine.

regards to all for your response


dear all,

After compiling in CCS C, I took it to proteus, but my LCD won't display anything, it will just lighten up...please help.[http://imageshack.us/photo/my-images/96/similarprj.png/][/url]
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