When we put together one or more commands to control the Linkbot robot, we are creating a "program." In other words, a computer program is like a recipe, a series of instructions to get something done. Often when we create a program we make mistakes, such as using the wrong command, or the right command at the wrong time, or the wrong numbers in the right command, or so on and so forth. These errors are called "bugs," and so we often need to "debug" the program in order to fix it and get it working properly. The Step button (just to the right of the Run button) is helpful in debugging, because it will step through a program's commands one at a time. At each step the command being executed is displayed in orange in the Workspace. This lesson gives you some practice in debugging, and also introduces the turn code block, which instructs the robot to turn left or right at a certain angle (90 degrees for a right angle turn): Tip: If you want to speed up the robot's journey, add a setSpeed block at the beginning. (You may have to scroll down in the list of code blocks to find it.)
|
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
|
|
|
Modify the pre-placed block and add more driveDistance and turn blocks to drive the robot through the obstacle course to the star, located at the point x = 34, y = 27. Make sure you do not cross the tape! |
|
|
|||||||||||
|
|||||||||||