Here is a Robolab-version for a KMZ51 compass rover.



We start using sub.vis in our Robolab programs for later use in order to make the programs more readable. The choice of sub-routines may seem redundant, but it isn't. For small routines, this doesn't make really sense, but for bigger code, a is ALWAYS incorporated completely in your program. So, every time you insert the same at different places in your program, the whole code will be inserted. This blows up your program enormously. With sub-routines this won't happen, because only your small call-line is inserted. UNFORTUNATELY you may not call a sub-routine from within a sub-routine under the original LEGO firmware.



is a similar that calls sub-routine 2


Robolab is a bit too busy resetting the rotation sensor every time you call a sub-routine. This is an unpleasant bug of ROBOLAB. So we have to replace the LEFT n sub-routine-call by two motor commands just in the midth of our program.


The program follows the scenario explained in the next pictures.


Note that this program neglects an influence of the rotation-direction on the sensor which we found already earlier in a ROBOLAB-investigation. So the real curve is NOT exactly symetrical. This should of course be respected in more sophisticated programs.



RetourMain Page