roaa said
Newbie level 4
- Joined
- Jul 6, 2013
- Messages
- 7
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 44
HELLO all
i have 16f677 .. i wrote the code and have no errors but when i simulate(proteus simulation) it didnot work properly
i wana to know where the error?
the code:
i have 16f677 .. i wrote the code and have no errors but when i simulate(proteus simulation) it didnot work properly
i wana to know where the error?
the code:
Code:
int sensor;
void main() {
TRISA=0Xff; //configure PORTA as input port
TRISC=0X00; //configure PORTC as output port
TRISB=0XFF; //configure PORTB as input port
sensor=RA0_bit;
do{
if(RB4_bit==1)
{
RC1_bit=1;
RC2_bit=1;
delay_ms(300);
}
if(sensor==1)
{
RC1_bit=1;
RC2_bit=1;
delay_ms(1000);
RC3_bit=1;
}
if(sensor==0)
{
RC1_bit=0;
RC2_bit=0;
RC3_bit=1;
}
delay_ms(3000);
RC1_bit=0;
RC2_bit=0;
RC3_bit=0;
RC4_bit=1;
RC5_bit=1;
}
while(1);
}
Last edited by a moderator: