Output state of button on NXT brick
Get the state of the "middle orange" or "right arrow" button on the NXT brick: 1 while pressed and 0 while released.
If you run a simulation of a model that contains this block without the target hardware, this block outputs zeroes. See Block Produces Zeros or Does Nothing in Simulation.
Measure the voltage of the batteries in the NXT brick.
Open the legonxtlib block library and copy the blocks shown to a new model.
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.
Detect and Fix Task Overruns on NXT Brick | Install Support for LEGO MINDSTORMS NXT Hardware | LEGO MINDSTORMS NXT Battery | LEGO MINDSTORMS NXT Button | LEGO MINDSTORMS NXT LCD | LEGO MINDSTORMS NXT Speaker | LEGO MINDSTORMS NXT Timer