- :-

Topics Covered

  • Data Wires
  • Random Block
  • Lesson Links

    Check Your Understanding:
    1. 1. How do you attach a Data Wire?
    2. Add a Data Wire node to the program and use its available connectors
      Select the two block to be attached with data wires, then go to Tools > Add Data Wires
      Drag a data output plug connector into a data input slot
      Use the "Draw Data Wires" button and draw data wires from block to block, connecting output ends to input ends
    3. 2. In the program you built, why does the robot run at a random speed?
    4. The Random Block supplied a random number, which was wired to the Move Steering Block's Power setting
      The robot acted on its own accord
      The Random Block came first in the sequence, and in consequence, the next immediate block will automatically have random data values
      Placing a Random Block anywhere in the program automatically randomizes the entire program
    Try It!
    Try it! 1

    Removing Data Wires

    What happens if you drag the plug connector back out of the spot where you plugged it in? Try it!

    What happens?

    Pulling out the plug deletes the wire and sets the block to use the typed-in setting again

    Try it! 2

    Context Help

    If you hold a data connector over a block, input terminals that can accept it will light up. But what does each one do with the values that it receives?

    • Open the Help menu, then select Context Help.

    Hover your mouse cursor over the wire terminal you want to know more about. Try it!

    What happens?

    The Context Help menu gives you a description of what values are accepted by that plug.

    Click More Information to see a more complete explanation of both the Block and its plugs.

    Mini Challenge

    Mini Challenge 1: Random Distance

    Make the robot move for a random distance (between 1 and 5 rotations):

        In the program above, the Data Wire was plugged into the Power input of the Move Steering Block to create randomized speeds. Which input would create randomized distance?

    What value on the Move Block needs to be replaced with the random number?

    You can set the minimum and maximum values for the Random Block by settings its Lower Bound and Upper Bound settings, respectively.

    + hint