I want to program my car(microC) to turn 180deg and after that detect the line and follow the line. I tried so many times that i can only manage it by using delay.
if(a==1)
{
u_turn();
delay_ms(2000);
a=0;
}
But this has problem that it is not constant. Sometimes after turn 180deg for 2sec, it may end outside the line. I have tried to put
if(a==1)
{
u_turn();
if(Sensor=sense)
{
a=0;
}
}
But it does not work. It even stop and does not turn at all.
Anyone have suggestion?
if(a==1)
{
u_turn();
delay_ms(2000);
a=0;
}
But this has problem that it is not constant. Sometimes after turn 180deg for 2sec, it may end outside the line. I have tried to put
if(a==1)
{
u_turn();
if(Sensor=sense)
{
a=0;
}
}
But it does not work. It even stop and does not turn at all.
Anyone have suggestion?