Documentation Center

  • Trial Software
  • Product Updates



Output state of button on NXT brick


Simulink Support Package for LEGO MINDSTORMS NXT Hardware


Get the state of the "middle orange" or "right arrow" button on the NXT brick: 1 while pressed and 0 while released.


Use the Button

Measure the voltage of the batteries in the NXT brick.


Connect the Button block to the LCD block, as shown.

Prepare and run the model on the NXT brick.

Press the orange button on the NXT brick, and observe 0 on the LCD display turn to 1.

Dialog Box


Select the button for which to output status. The options are Middle orange and Right arrow.

Sample time

Specify how often the block reads the state of the button.


See Also

| | | | | |

External Web Sites

Was this topic helpful?