taskmain()
{
SetSensor(SENSOR_1,SENSOR_LIGHT);
max = SENSOR_1;
CrearTimer(0);
time = Timer(0);
while(Timer(0) <= 75)
{
OnRev(OUT_A);
if(SENSOR_1 > max)
{
ClearTimer(1);
max = SENSOR_1;
}
else
{
max = max;
time =Timer(1);
}
}
ClearTimer(1);
while(Timer(1) <= 75 - time)
{
OnRev(OUT_A);
}
OnFwd(OUT_A);
}