Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in /home3/validus/public_html/wp-includes/class-wp-hook.php on line 298

04 – Programming the PicAxe Microbot for Bumper Collusions.

The bumper switches are used to register collisions and appropriate action can then be taken to guide the Microbot based on the inputs. The code example illustrates a very basic way to navigate the Microbot, more complex routines can be developed to control and steer the Microbot.


 

This program drives the Microbot forward until it bumps into something and the bumper switches registers a collision. It then reverses a short distance and turn right or left based on the activated bumper switch. After the left or right spin the Microbot starts moving forward again.

You can download the program file, Bot120 Bumper Collusions by right clicking on it and selecting ‘save link as’ from the popup menu.