flyingfrancisco
Newbie level 6
- Joined
- Mar 22, 2011
- Messages
- 11
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Green Valley, Ontario
- Activity points
- 1,348
Hello everyone
I am both new to this site and new to Pic programming.Can someone tell me what is wrong with this. It will not build in MikroC and I get the first error at line 10 " Syntax error Expected ")' but found "="
unsigned long value; // store the value of channel0
unsigned char d1,d2,d3,d4,*text; //d1,d2,d3,d4, are to convert the input data
#define printV lcd_chr(2,11,d1+48); lcd_chr_cp(d2+48);\
lcd_chr_cp(*.*); lcd_chr_cp(d3+48);\
lcd_chr_cp(d4+48); lcd_out_cp("V");
void main()
(
adcon1=0b10000010; // analog channels activated
trisa=0xff; // PortA configured as input
lcd_config(&portb,1,3,2,7,6,5,4,);
lcd_cmd(LCD_CURSOR_OFF);
lcd_cmd(LCD_CLEAR);
text=("PACO's Project");
lcd_out(1,2,text);
text=("voltage:");
lcd_out(2,1,text);
for(;
(
value=adc_read(0);
value=value*5000/1023:
d1=value/1000:
d2=(value%1000)/100;
d3=((value%1000)%100)/10;
d4=((value%1000)%100)%10;
printV;
delay_ms(20);
)
)
I am both new to this site and new to Pic programming.Can someone tell me what is wrong with this. It will not build in MikroC and I get the first error at line 10 " Syntax error Expected ")' but found "="
unsigned long value; // store the value of channel0
unsigned char d1,d2,d3,d4,*text; //d1,d2,d3,d4, are to convert the input data
#define printV lcd_chr(2,11,d1+48); lcd_chr_cp(d2+48);\
lcd_chr_cp(*.*); lcd_chr_cp(d3+48);\
lcd_chr_cp(d4+48); lcd_out_cp("V");
void main()
(
adcon1=0b10000010; // analog channels activated
trisa=0xff; // PortA configured as input
lcd_config(&portb,1,3,2,7,6,5,4,);
lcd_cmd(LCD_CURSOR_OFF);
lcd_cmd(LCD_CLEAR);
text=("PACO's Project");
lcd_out(1,2,text);
text=("voltage:");
lcd_out(2,1,text);
for(;
(
value=adc_read(0);
value=value*5000/1023:
d1=value/1000:
d2=(value%1000)/100;
d3=((value%1000)%100)/10;
d4=((value%1000)%100)%10;
printV;
delay_ms(20);
)
)
Last edited by a moderator: