LEGO Engineering

| | | | | | | |
What is the NXT-G Range block for?


19th of April, 2010

(1 )
100% thumbs up 0% thumbs down

The 'Range' block (located in the 'Advanced' section in the 'complete palette' tab on the left side of the screen) is used to determine whether an input number, called the 'test value', is within the specified range.  To configure it, adjust the two sliders in the block’s configuration panel as shown below. In the program below, the test value is manually entered as 50.  However, the test value can also be a numerical output wired in from another block.   



Rather than testing a manually input test value, the attached program determines whether or not a random number is within the given range.  If it is, it prints “Within Range”, or else it prints “Not in Range”.  

You can also use this block to make the robot behave in a certain way depending on whether the intensity measured by the light or sound sensor is within a certain range.
   :
   :
* :
* :
 


Home | About Us | Contact Us

© 2013 Center for Engineering Educational Outreach, Tufts University
© 2013 The LEGO Group. All rights reserved.