//debug version, max ball feeding int AmbLevelThr1; int AmbLevelThr2; task main () { SetSensorType (SENSOR_1, SENSOR_TYPE_LIGHT); SetSensorMode (SENSOR_1, SENSOR_MODE_RAW); SetSensorType (SENSOR_2, SENSOR_TYPE_LIGHT); SetSensorMode (SENSOR_2, SENSOR_MODE_RAW); Wait(10); while (true) { AmbLevelThr1 = SENSOR_1 - 9; AmbLevelThr2 = SENSOR_2 - 8; OnFwd (OUT_A); ClearTimer (1); until ((SENSOR_1 < AmbLevelThr1)||(SENSOR_2 < AmbLevelThr2)) { if(Timer(1)>600) { Off (OUT_A); //No ball detected for 1min, Stop all!) PlaySound (SOUND_DOWN); StopAllTasks (); } } PlaySound (SOUND_CLICK); Wait(100); } }