task main() { SetSensor(SENSOR_1,SENSOR_LIGHT); SetSensor(SENSOR_2,SENSOR_ROTATION); SetSensor(SENSOR_3,SENSOR_TOUCH); SetPower(OUT_A,2); SetPower(OUT_B,1); SetDirection(OUT_A+OUT_B,OUT_REV); OnFor(OUT_A,400); Off(OUT_A); On(OUT_B); Wait(3); while(SENSOR_3!=1) {} Off(OUT_B); SetDirection(OUT_A+OUT_B,OUT_FWD); PlaySound(SOUND_CLICK); CreateDatalog(1500); int dat; int firstval; int secondval; int curcol; int maxcol; int curstat; int currot; dat=0; maxcol=0; curstat=4444; ClearMessage(); while (curstat==4444 && Message()!=1) {} curstat=0; while (curstat!=5555) { curcol=0; On(OUT_B); ClearMessage(); while(SENSOR_3==1) { firstval=SENSOR_1; ClearSensor(SENSOR_2); currot=SENSOR_2+1; while (SENSOR_2=1500-maxcol) { PlaySound(SOUND_DOUBLE_BEEP); curstat=9999; while(curstat>0) { if(Message()==1) { curstat=5555; } } CreateDatalog(1500); dat=0; } OnFor(OUT_A,4); Off(OUT_A); } SetDirection(OUT_A+OUT_B,OUT_REV); OnFor(OUT_A,400); Off(OUT_A); On(OUT_B); Wait(3); while(SENSOR_3!=1) {} Off(OUT_B); SetDirection(OUT_A+OUT_B,OUT_FWD); PlaySound(SOUND_DOUBLE_BEEP); curstat=9999; while(curstat>0); PlaySound(SOUND_DOWN); }