Challenge 9: Bumperbot
- rainbowsandalex
- Apr 25, 2016
- 1 min read
In this challenge we were asked to make our robots wander around a room until they bump into something, then back up and turn around before wandering again.
Pseudocode:
Loop
- Make the robot drive in a wide wiggling line for an endless amount of time
- Go forwards making a very gradual turn to the right
- Then make a turn at the same angle to the left
-Wait until the touch sensor is pressed
- drive directly backwards for 0.8 rotations
- Make the robot turn just over 90 degrees so it is facing away from the wall
End loop, repeat infinitely
Reflection:
This challenge has a pretty simple concept, and the code was very easy to write. The only hard part was building it so that the buttons were centered enough to activate when pressed from various angles.
I ended up re building the entire thing once, changing the placement of the buttons and redesigning the "wall" that is bumped so that it is sturdier.
This is how the code looked

Eventually the whole thing did work well, after plenty of time spent building.
I learned a lot about how finicky sensors can be, and how to optimize my build so that they work how they should.
For the next challenge I would like to spend less time building and more time on the program itself
this is how it looked:


Comments