|
|
| What is the NXT-G Compare block for? |
| (8 ) |
100%
0%
|
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.
|