In the previous lesson we learned to use the turn command, so now it's possible for us to create programs that have the Linkbot draw geometrical shapes. We'll start with simple squares, and to make things more colorful, we'll use the "traceColor" command to change the color of the robot's trace as it travels along, and the "trace" command to turn the trace off or on. We'll also introduce the "drivexyTo" command, which tells the robot to drive in a straight line to a specified (x,y) position 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
|
|
|
By changing the values in the preplaced code blocks, have the Linkbot draw a blue square with sides of length 8. The bottom side will be along the positive x axis, and the left side will be along the positive y axis. Then turn the trace off and use the drivexyTo command to move the robot to the position x = 6 and y = 6. Finally, add commands to turn the trace on, change it to green, and have the robot draw a square of side 4 inside the blue square. |
|
|
|||||||||||
|
|||||||||||