Reads state of NXT touch sensor
金宝app®Support Package for LEGO®MINDSTORMS®EV3 Hardware / NXT Sensors
TheNXT Touch Sensorblock detects whether the NXT touch sensor connected to the LEGO MINDSTORMS EV3 brick is being pressed:
0
= Not pressed
1
= Pressed
During simulations without hardware, this block emits zeros. SeeBlock Produces Zeros or Does Nothing in Simulation.
Open thelegoev3nxtlib
block library and copy theNXT Touch Sensorblock to a new model.
Open thelegoev3lib
block library and copy theDisplayblock to the same model and connect these blocks.
Connect the touch sensor to port 1 of the EV3 brick.
Prepare and run the model on the EV3 brick as described inRun Model on EV3 Hardware. Observe the state of the touch sensor on the LCD display of the EV3 brick while you press and release the touch sensor.
Select the EV3 sensor port to which the sensor is connected. Avoid assigning multiple devices to the same port. The options are1
,2
,3
, or4
.
Specify how often the block reads sensor values.
Smaller values require the processor to complete the same number of instructions in less time, which can cause task overruns.