Hi all,
Anybody can help me to do programming in line crossing when want tu turn at junction especially for robocon. Here i already done the line tracing program. I cannot do the line crossing program because not familiar with MC40SE board. The program that i want is when robot cross 5 lane then the robot turn left. Please help me. Below is the program that i have done.
while(1)
{
if((SEN1==1)&& (SEN2==0)&&(SEN3==1))
{
brushless(PORT1, RUN, CW, 800);
brushless(PORT2, RUN, CCW, 800);
}
if((SEN1==0)&& (SEN2==0)&&(SEN3==1))
{
brushless(PORT1, RUN, CW, 500);
}
if((SEN1==1)&& (SEN2==0)&&(SEN3==0))
{
brushless(PORT2, RUN, CCW, 500);
}
else if((SEN1==1)&& (SEN2==1)&&(SEN3==1))
{
brushless(PORT1, BRAKE, CW, 0);
brushless(PORT2, BRAKE, CCW, 0);
}
}
while(1); //infinite loop