LEGO Engineering

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


19th of April, 2010

(8 )
100% thumbs up 0% thumbs down

The Compare block (located in the 'Data' section in the 'complete palette' tab on the left side of the screen) is used to compare two numerical values. It outputs 'true' or 'false' depending on whether the condition chosen in the configuration panel is satisfied.

The attached program, compare.rbt, makes the robot move forward if the light sensor intensity is above 50 and backwards if it is below 50.  

Please note that there are many alternatives to the Compare block. Many of the other blocks, including 'Wait For,' 'Loop,' and 'Range,' have functions dealing with the comparison of values.
   :
   :
* :
* :
 


Home | About Us | Contact Us

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