/* line following program - slide 42*/
/* place robot over dark line */
void main()
{
int dark;
/* get the dark light value */
dark=light(1);
printf("%d", dark);
while(prgm_button()==0)
{
printf("%d" light(1) -dark);
/* look for less dark by at least 30 */
if(light() < dark-30)
{ /* turn one way */
fd(1); off(3);
}
else
{ /* turn the other way */
off(1); fd(3);
}
}
while (touch(FRONT_SENSOR) ==0)
{
// do nothing
}
// wait
alloff();
}