Week 5 – Oliver

This week Richard had a challenge week with me and James only. We had a list of pseudocode instructions to make the robot follow, shown below:

1. Move forwards in a straight line
2. If a red, green or a yellow tile is detected stop and wait for one second
3. If the tile is red, stay stopped
4. If the tile is yellow, move forwards until it is not yellow and go back to 1
5. If the tile is green, wiggle side to side 3 times and go back to 1

This is a lot harder than it may seem. We had to use many different block types to make the program work, and I feel like I have learned something new to try on my robot at home.

My code is still not perfected, but this is my unfinished result. I have written step by step of how my program works:

  1. Move forward until one of the three colours is found.
  2.  Wait 1 second.
  3. If the colour is red then stop motors, say “RED” and then go back to the beginning.
  4. If the colour is not red then if the colour is yellow then;
  5. Until the colour is not yellow move forward then go back to 1.
  6. If the colour is not red nor yellow and it is green then stop motors, run the My Block called “The_Wiggles” and then go back to 1.

I have used Nested Loops (loops inside each other) in my program. Right now, it does not work, so I wonder if I choose a different format of laying out my code it would work better? I am going to try that next week.

My Wiggle Block

This My Block starts by turning the robot 25 wheel degrees left by moving the wheels. It then repeats turning 50 wheel degrees left and right 3 more times. Then it finally finished by turning 25 wheel degrees right.

WORD OF THE DAY: Petrichor The smell when rain and soil combine.