NxtTouchSensor

Last Updated On 2021-07-16

Version 1MinSDK 7Tutorial Video

A component that provides a high-level interface to a touch sensor on a LEGO MINDSTORMS NXT robot.


Properties

You can set the below properties in the UI part of the builder.

  • BluetoothClient - it's a BluetoothClient value which is set to blank by default.
  • PressedEventEnabled - it's a boolean value which is set to false by default.
  • ReleasedEventEnabled - it's a boolean value which is set to false by default.
  • SensorPort - it's a lego nxt sensor port value which is set to 1 by default.

Block Properties

You can set the below blocks properties in the blocks section of the builder.

PressedEventEnabled

Whether the Pressed event should fire when the touch sensor is pressed.


ReleasedEventEnabled

Whether the Released event should fire when the touch sensor is released.



Methods

You can set the below method blocks in the blocks section of the builder.

IsPressed

Returns true if the touch sensor is pressed.


Events

You can set the below event blocks in the blocks section of the builder.

Pressed

Touch sensor has been pressed.

Released

Touch sensor has been released.