LEGO Engineering

| | | | | | | |
My program won't do what I told it to do!


23rd of April, 2010

(4 )
75% thumbs up 25% thumbs down

If the program seems to skip over a task, most likely there was no 'wait for' condition after the tasks in the program. This means that the tasks in the program were run, but so fast that it appears the program is doing nothing.
For example, assume there is a program in which motors A and C move forward, stop, change direction and stop again. If this program was executed, it would appear that nothing was happening.

Have the tasks (in this case, moving the motors forward, then backward) be executed for a certain time or until a certain event takes place using a 'wait for' icon. By adding in a 'wait for 2s' block after the forward motor command in the example program and a 'wait for touch' block after the backward motor command, the motors move forward for 2 seconds, stop, reverse direction and drive until a touch sensor is pushed. Then the motors stop again, and the program ends.





ses
   :
   :
* :
* :