View previous topic :: View next topic |
Author |
Message |
bimba
Joined: 12 Jan 2013 Posts: 12
|
compiling error |
Posted: Sun Feb 17, 2013 2:51 pm |
|
|
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
|
|
Posted: Sun Feb 17, 2013 3:10 pm |
|
|
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
|
|
Posted: Sun Feb 17, 2013 3:52 pm |
|
|
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
|
|
Posted: Sun Feb 17, 2013 5:07 pm |
|
|
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
|
|
Posted: Sun Feb 17, 2013 5:31 pm |
|
|
It's essential to read the forum guide.
Which compiler version are you using?
Mike |
|
|
bimba
Joined: 12 Jan 2013 Posts: 12
|
|
Posted: Mon Feb 18, 2013 4:28 am |
|
|
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
|
|
Posted: Mon Feb 18, 2013 7:23 am |
|
|
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
|
|
Posted: Tue Feb 19, 2013 6:46 am |
|
|
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
|
|
Posted: Tue Feb 19, 2013 9:37 am |
|
|
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] |
|
|
|