All pastes #742997 Raw Edit

Untitled

public text v1 · immutable
·published 2007-10-20 00:05 UTC
rendered paste body
#define THRESH 37
#define TURNTIME 13
#define BACKTIME 18

task main()
{
repeat (15)
{
SetSensor(SENSOR_2, SENSOR_LIGHT);
SetPower(OUT_A,5);
SetPower(OUT_C,5);
OnFwd(OUT_A+OUT_C);
while (true)
{
if (SENSOR_2 < THRESH)
{
Off(OUT_A+OUT_C);
Wait(10);
OnRev(OUT_A+OUT_C);
Wait(BACKTIME);
OnFwd(OUT_C);
OnRev(OUT_A);
Wait(TURNTIME);
OnFwd(OUT_A+OUT_C);
Off(OUT_A+OUT_C);
}
}
}
}