DesignThrough out my project, I constantly added and improved my design making sure that the base of the robot was solid.
DevelopmentProgramming my mind storm robot
Edge detectionI first started of with edge detection; this was really easy to do using a while loop and a condition for the light. I found out the value of the white around the arena was about 45% but it changed a lot depending in the light around the room and the time of day. This meant that ideally it needed to be tested and reprogrammed into the robot before the final battle.
MovementNext was setting up the ultra sonic sensor to detect objects that are close range to the robot and make the robot charge forward. This was achieved by simply inserting a switch into the while loop. It’s kind of like If and else.
If object is 30 cm or closer, motors move forward at 100 % speed. Else do nothing.
This did not work well since the ultra sonic sensor was up to high and not detecting some of the lower robots. To solve this problem we changed the height of the sensor so it was closer to the ground, while at the same time making sure that it wasn’t to low so that it would pick up the ground.
Next was making the robot rotate, this was the easiest to do since all I had to drag and drop the move tool and set the number of rotations to unlimited.
The last was adding the condition of making the robot wait 5 seconds before starting the battle. This was simple as most of my program was already assembled. I just inserted the wait command before the start of my while loop.
My program now looked like this in a programming point of view.
Wait 5 seconds
While loop
{
Rotate forever
If light sensor = less than 45% go back for 3 seconds
If ultra sonic sensor = 30 cm or less charge forward at 100 % speed.
}
This simple but effective program worked well and helped ensure our victory over the other robots in the classroom.
TestingWhen programming my robot, I made a few errors in my program such using the wrong values in my light sensor. I vigilantly tested my program to ensure that there were no bugs by the time the deadline came.