the compare block

The next programmable timer uses the Compare block to compare two numbers. The Compare block is in the Data group of the Complete Palette (shown in Figure 10-18) and will appear in your program as shown in Figure 10-19. You can supply the two input values using data wires or the Configuration Panel (shown in Figure 10-20). The comparison is made based on the operation selected, which can be either Less than, Greater than, or Equals. The result of the comparison is written to an output data plug.

The Compare block on the Complete Palette

Figure 10-18. The Compare block on the Complete Palette

Figure 10-19. The Compare block

Figure 10-20. The Compare block’s Configuration Panel ...

Get The Art of LEGO MINDSTORMS NXT-G Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.