http://legosforkids.wordpress.com/2009/03/08/winston/
This is a robotic vehicle I made. The video shows it navigating a makeshift arena, doing its best not to bump into things.
It uses the ultra-sonic sensor to 'see' objects in its path. If it sees an object it reverses and steers in a random direction. It also has a bumper on it in case the ultra-sonic misses something low or in its blind spots.
It has one motor driving a differential. The differential is there to help the steering.
The other motor controls the steering; it random chooses a direction to drive in (1:20 chance of left, 1:20 chance of right, 18:20 chance of it not steering left or right.
Not the most advanced robot ever but it satisfies some personal goals I'd set myself. :)
See more of my LEGO at http://legosforkids.wordpress.com
I solved this problem back in the original Mindstorms with the RCX. I called it Better Bumper. It had two bumbers, if both were triggered within a certain amount of time, it backed up, turned 180 degrees and went on. In your case, since you have only one touch sensor, you could program it for two triggers within say, 3 seconds of each other.
neamerjell 3 months ago