Hello guys,
first I would apologise for my English since it's a bit weak.
okay, well I have a small project to do this year ( a line follower), I have installed Proteus and MikroC, I'm learning how to work with them since I'm a begginer.
anyway, I have made my circtuis in proteus here it is:

and my MicroC porgram is:
as I said I'm a begginer and I know it's wrong, but could someone tell me where I'm wrong? what should I do to make the condition "if" work?
Moderators note: Please use code tags for pieces of code
first I would apologise for my English since it's a bit weak.
okay, well I have a small project to do this year ( a line follower), I have installed Proteus and MikroC, I'm learning how to work with them since I'm a begginer.
anyway, I have made my circtuis in proteus here it is:
and my MicroC porgram is:
Code:
void main(){
TRISA=0xFF; PORTA=0xFF;
TRISC=0x00; PORTC=0x00;
for(;;){
if(RA0_bit==0 && RA1_bit==0 && RA2_bit==0){
RC1_bit=0; RC2_bit=0; RC3_bit=0; RC4_bit=0;}
else if(RA0_bit==1 && RA1_bit==1 && RA2_bit==0){
RC1_bit=1; RC2_bit=0; RC3_bit=1; RC4_bit=0;}
else if(RA0_bit==1 && RA1_bit==0 && RA2_bit==0){
RC1_bit=0; RC2_bit=1; RC3_bit=1; RC4_bit=0;}
else if(RA0_bit==1 && RA1_bit==0 && RA2_bit==0){
RC1_bit=1; RC2_bit=0; RC3_bit=0; RC4_bit=1;}
}
}
Moderators note: Please use code tags for pieces of code
Last edited by a moderator: