NXTTouchSensor Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Create a NXT Touch sensor class
public class NXTTouchSensor : Iot.Device.BrickPi3.Sensors.ISensor, System.ComponentModel.INotifyPropertyChanged
type NXTTouchSensor = class
interface INotifyPropertyChanged
interface ISensor
Public Class NXTTouchSensor
Implements INotifyPropertyChanged, ISensor
- Inheritance
-
NXTTouchSensor
- Implements
Constructors
NXTTouchSensor(Brick, SensorPort) |
Initialize a new NXT Touch sensor |
NXTTouchSensor(Brick, SensorPort, Int32) |
Initialize a new NXT Touch sensor |
Properties
PeriodRefresh |
Period to refresh the notification of property changed in milliseconds |
Port |
Return port |
Value |
Return the raw value of the sensor |
ValueAsString |
Return the raw value as a string of the sensor |
Methods
GetSensorName() |
Gets sensor name |
IsPressed() |
Determines whether the touch sensor is pressed. |
NumberOfModes() |
Number of modes supported |
ReadAsString() |
Reads the sensor value as a string. |
ReadRaw() |
Reads the raw sensor value |
SelectedMode() |
Selected mode |
SelectNextMode() |
Moves to next mode |
SelectPreviousMode() |
Moves to previous mode |
UpdateSensor(Object) |
Update the sensor and this will raised an event on the interface |
Events
PropertyChanged |
To notify a property has changed. The minimum time can be set up with timeout property |
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for