Learn to program

 
  Scribbler assignments ::

 

 
 

Assignment 10: Football Practice

Use what you learned in the last lesson to program your robot to do Football Practice.

football practice

Create a program that does the following:

  • Begin at start
  • travel to line 1, using the IR sensors to stop at Line 1
  • at Line 1, turn around and return to Start
  • At Start, turn around and travel to Line 2, using the IR sensors to stop at Line 2
  • At line 2, turn around and return to Start
  • At Start, turn around and travel to Line 3, using the IR sensors to stop at Line 3
  • At Line 3, turn around and return to Start.
  • At Start, stop.

Remember, FIRST WRITE AN ALGORITHM. (Hint - what do you think the instructions above are?) Show it to me before you start on the program.

Turn the algorithm in to Shared - Students - Pereira - A.i. 201x - Class color - 10 Algorithm

as algorithmyourname.

Then write the program.

Think: Look at the instructions above. Look at the pink bits. They are repeated over and over again.

Actions that are repeated over and over again should be run in a subroutine.

Make a subroutine that does "stop at the line; turn 180 degrees". Remember that you have
the instructions for 'turn 180 degrees' in your Turns assignment.

Mkae the robot go forward, then call the subroutine from the main program.

Make sure I see it running.

Turn the program in to Shared - Students - Pereira - A.i. 201x - Class color - 10 Football as footballyourname.

 

 

Write a Reflection on what you have learned.