Just like a car, a robot can move fast or slow. You can control the speed that the robot is moving with the setSpeed block. It has one input value, which is the rate the robot is moving, in units/second:
You can use a setSpeed block at the beginning of the code to set the speed for all later robot movements. You can also add a setSpeed block before any driveDistance block to specify how fast the robot should drive for that distance: Later driveDistance blocks in the code will use the speed set by the most recent setSpeed block. You can test the time it takes for the robot to go different distances at different speeds by using the timer to see how long it takes for a program to run. (The timer is in the middle section, just below the trash can icon.) Click the Video at top right to learn more and see a demonstration.
|
The code drives the robot forward 12 units at 3 units per second. |
Grid Lines: | ||
Tics Lines: |
|
Width
px
|
Hash Lines: |
|
Width
px
|
Labels: |
|
Font
px
|
Trace Lines: | ||
Robot 1: |
|
Width
px
|
Robot 2: |
|
Width
px
|
Robot 3: |
|
Width
px
|
Robot 4: |
|
Width
px
|
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: | |
Label: |
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|||||||||||