C# Class BrickPi.Sensors.NXTUltraSonicSensor

Inheritance: INotifyPropertyChanged, ISensor
Datei anzeigen Open project: Ellerbach/BrickPi Class Usage Examples

Public Methods

Method Description
GetSensorName ( ) : string
NXTUltraSonicSensor ( BrickPortSensor port ) : System

Initialize a NXT Ultrasonic sensor

NXTUltraSonicSensor ( BrickPortSensor port, UltraSonicMode mode ) : System

Initialize a NXT Ultrasonic sensor

NXTUltraSonicSensor ( BrickPortSensor port, UltraSonicMode mode, int timeout ) : System

Initialize a NXT Ultrasonic sensor

NumberOfModes ( ) : int
ReadAsString ( ) : string
ReadDistance ( ) : float

Read the distance in either centiinches or centimeter

ReadRaw ( ) : int

The raw value from the sensor

SelectNextMode ( ) : void
SelectPreviousMode ( ) : void
SelectedMode ( ) : string
UpdateSensor ( object state ) : void

Update the sensor and this will raised an event on the interface

Private Methods

Method Description
OnPropertyChanged ( string name ) : void
StopTimerInternal ( ) : void

Method Details

GetSensorName() public method

public GetSensorName ( ) : string
return string

NXTUltraSonicSensor() public method

Initialize a NXT Ultrasonic sensor
public NXTUltraSonicSensor ( BrickPortSensor port ) : System
port BrickPortSensor Sensor port
return System

NXTUltraSonicSensor() public method

Initialize a NXT Ultrasonic sensor
public NXTUltraSonicSensor ( BrickPortSensor port, UltraSonicMode mode ) : System
port BrickPortSensor Sensor port
mode UltraSonicMode Ultrasonic mode
return System

NXTUltraSonicSensor() public method

Initialize a NXT Ultrasonic sensor
public NXTUltraSonicSensor ( BrickPortSensor port, UltraSonicMode mode, int timeout ) : System
port BrickPortSensor Sensor port
mode UltraSonicMode Ultrasonic mode
timeout int Period in millisecond to check sensor value changes
return System

NumberOfModes() public method

public NumberOfModes ( ) : int
return int

ReadAsString() public method

public ReadAsString ( ) : string
return string

ReadDistance() public method

Read the distance in either centiinches or centimeter
public ReadDistance ( ) : float
return float

ReadRaw() public method

The raw value from the sensor
public ReadRaw ( ) : int
return int

SelectNextMode() public method

public SelectNextMode ( ) : void
return void

SelectPreviousMode() public method

public SelectPreviousMode ( ) : void
return void

SelectedMode() public method

public SelectedMode ( ) : string
return string

UpdateSensor() public method

Update the sensor and this will raised an event on the interface
public UpdateSensor ( object state ) : void
state object
return void