Learning Math and CS with Robotics
Sign In

CSP Unit 3 Lesson 7.2

Piano
Linkbot Image Mindstorm Image
Grid Size: S M L Simple View: MinView:
CSP Unit 3 Lesson 7.2

In this activity we give a name to something you have already been doing. You may have noticed that some commands we have been using require an input value. In the case of driveDistance, for example, we must supply the distance to be moved in terms of the number of units on the grid. In progamming terminology, we say that driveDistance "accepts a parameter," and that the input value is supplied, or given, to the parameter. The parameter value goes within parentheses after the command's name. In contrast, the traceOn and traceOff commands do not have a parameter--no input value is required, and the parentheses for them are empty. Using only the turnRight and driveDistance commands, see if you can adjust their parameter values to travel in a straight line from the robot's starting point to the far upper right corner of the grid (the point x = 24, y = 24) without going off the grid. How far is it? Compare your best answer with your neighbor's.

Load Blocks
Hardware
LArduino
Workspace Save File Show Ch Edit Ch Console

		
Rubbish bin
Time