In normal programming code, each code block must be executed completely before the next block is run. This means, for example, that you can only have one robot moving at a time. Sometimes, however, you want multiple robots to move together. It's possible to do this using a special type of block called Non-Blocking (NB) blocks. With a "non-blocking" block, RoboBlockly will start the block's execution and then immediately move on to the next blocks in sequence while the non-blocking block continues executing. That is, the "non-blocking" block does not block execution of later blocks (thus the name "non-blocking"). An example of a non-blocking block is the driveDistanceNB block: We also use the moveWait block with non-blocking blocks to wait for all the non-blocking action to finish before ending the program: Watch the video to learn more about how to use non-blocking blocks.
|
Position Robot 1 on the grid at (0, 0), facing 90 degrees (upward) and robot 2 on the grid at (14, 0) facing 270 degrees (downward). Create a program that has the robots chase each other in a circle. Use the driveDistanceNB block for Robot 1 and the regular driveDistance block for Robot 2. |
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
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
(
,
in
) in
|
|
![]() |
|
|
|||||||||||
|
|||||||||||