In our first lesson you learned how to move a Linkbot robot using a single driveDistance command. In this lesson you will learn how to use multiple driveDistance commands to move the robot along the number line. It will also give you a little practice with adding and subtracting numbers. To add a new driveDistance command to the Workspace, use the computer mouse (or trackpad) to drag and drop a driveDistance code block from the Blocks section in the middle to the Workspace on the right, and position it just under the pre-placed code block so that they click together. Repeat this process for as many code blocks as you need, and then change the arguments (input values) for each code block as needed. Then click the Run button, and the code blocks will be executed in sequence, one by one. You can also step through them slowly one at a time by clicking the "Step" button instead of the Run button. Tip: To see the distance traveled more clearly, you can uncheck the "Show Robot" box in the "Robot 1" section (lower left) to hide the image of the robot.
|
Grid Size: S M L | Simple View: | MinView: |
|
Coord: x-axis y-axis | Grid Lines: x-axis y-axis | |||
Grid: | 12x12 inches | 24x24 inches | 36x36 inches | |
72x72 inches | 96x96 inches | 192x192 inches | ||
1x1 inches | 2x2 inches | Fraction: | ||
xy-Range: | ||||
|
||||
|
||||
Quad: | 1 Quadrant | 4 Quadrants | 1&4 Quadrants | |
Units: | US Customary | Metric | Ruler: |
Labels: |
|
|
|
Font
px
|
|
Tics Lines: |
|
Width
px
|
Hash Lines: |
|
Width
px
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
(
,
in
) in
|
|
degrees
|
|
|
Starting at the origin (0), the Linkbot wants to travel along the number line in three segments. The first pre-placed driveDistance command moves it to the point x = 7. Add another command to move it to x = 10, and then one more to have the robot end its trip at x = 1. |
|
|
|||||||||||
|
|||||||||||