In this series of Hour of Code activities, you will learn how to guide the Linkbot robot as a robotic autonomous vehicle through a test track of criss-crossing streets. You’ll also learn about one of the most important concepts in computer programming--loops--and get a little practice using the Pythagorean theorem to traverse triangular paths. You can control the robot's movements on the grid on the left side of the window by dragging and dropping various "code blocks," or "commands," from the middle "Block" section to the "Workspace" on the right and then clicking the "Run" button (located just below the grid). These commands are simply instructions that tell the robot what to do. Once the commands are in place, clicking the Run button will cause the computer to run or "execute" the commands in sequence, one after the other, thus activating and controlling the robot. We will get the hang of it by starting with just a single command that has already been placed in the Workspace for you--the driveDistance command: To tell the robot how far to move, you enter a number into the blue box that is in the driveDistance command, then click Run. This number is called the "argument" for the command. To move the robot again, click "Reset" (which appears in place of the Run button after something is run), enter a different value for the argument, and then click Run again. (If you have a hardware Linkbot robot connected, the hardware robot will move in the same way as the virtual robot you see on the grid.)
|
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
|
|
|
Our robotic autonomus vehicle starts at the point (x=3, y=3) at one corner of the street grid, facing to the right. Each street block is 6 units square. Change the argument value in the pre-placed code block so that it will move ahead two street blocks to the right, following the light blue line to the point (15,3). |
|
|
|||||||||||
|
|||||||||||