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): To add a code block to the Workspace, drag and drop it from the Blocks section in the middle, positioning the block just above or below existing blocks in the Workspace, so that the new block clicks together with the existing ones. You can unhook blocks in the Workspace by dragging down on a block. Delete a block by dragging it back over to the Blocks section. 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
|
|
degrees
|
|
(
,
) in
|
|
degrees
|
|
(
,
) in
|
|
degrees
|
|
(
,
) in
|
|
degrees
|
|
(
,
) in
|
|
degrees
|
|
|
(
,
) in
|
|
degrees
|
|
|
|
Use the Step button to step through the pre-placed blocks to see what they do, and then add more turn and driveDistance blocks to drive the RAV robot around the 2-block by 2-block street square (outlined in blue), so that the RAV returns to its original position at the point (3,3), facing to the right. |
|
|
|||||||||||
|
|||||||||||