Week 9 – Oliver

This week we used maths and logic blocks to make sure the robot hits the can perfectly and has no chance of missing it. I had to use a maths block, variable and loop to make a counter to get the can in the dead centre.

(New) Pseudocode:
1. When the robot reaches the green area, stop moving.
2. Turn on axis anticlockwise until an object is detected within a range of 60cm. (can)
3. Turn 1 degree at a time anticlockwise until the can is not detected while counting number of degrees.
4. Halve the number of degrees turned and turn clockwise that number.
5. Wait 2 seconds then move forward for 3.5 rotations.

We made this extra part because the robot frequently used to miss the can. The old program worked but Richard said that we can’t go up to the course like we did today and say “my robot can’t detect that” and move the can.

Some problems that I faced were connecting the variables to the math and movement blocks and getting the loop in the right place. I couldn’t copy the original code because the infinite loop would mess up the robot from getting the can.

We didn’t need to add the bumper attachment because the robot always hit the can straight on with our new algorithm. We measured how far it was to the farthest point of the green circle from where the line following course finished and made the robot only go slightly more than that.

This is my final code:

WORD OF THE DAY: Sesquipedalianism. The tendency to use long words.