C# Class BrickPi.Sensors.EV3IRSensor

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

Public Methods

Method Description
EV3IRSensor ( BrickPortSensor port ) : System

Initialize an EV3 IR Sensor

EV3IRSensor ( BrickPortSensor port, IRMode mode ) : System

Initializes an EV3 IS Sensor

EV3IRSensor ( BrickPortSensor port, IRMode mode, int timeout ) : System

Initialize an EV3 IR Sensor

GetSensorName ( ) : string
NumberOfModes ( ) : int
Read ( ) : int

Read the sensor value. The returned value depends on the mode. Distance in proximity mode. Remote command number in remote mode. Beacon location in seek mode.

ReadAsString ( ) : string

Reads the sensor value as a string.

ReadBeaconLocation ( ) : int

Gets the beacon location. This will change the mode to seek

ReadDistance ( ) : int

Read the distance of the sensor in CM (0-100). This will change mode to proximity

ReadRaw ( ) : int

Read the sensor value

ReadRemoteCommand ( ) : byte

Reads commands from the IR-Remote. This will change mode to remote

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

EV3IRSensor() public method

Initialize an EV3 IR Sensor
public EV3IRSensor ( BrickPortSensor port ) : System
port BrickPortSensor Sensor port
return System

EV3IRSensor() public method

Initializes an EV3 IS Sensor
public EV3IRSensor ( BrickPortSensor port, IRMode mode ) : System
port BrickPortSensor
mode IRMode IR mode
return System

EV3IRSensor() public method

Initialize an EV3 IR Sensor
public EV3IRSensor ( BrickPortSensor port, IRMode mode, int timeout ) : System
port BrickPortSensor Sensor port
mode IRMode IR mode
timeout int Period in millisecond to check sensor value changes
return System

GetSensorName() public method

public GetSensorName ( ) : string
return string

NumberOfModes() public method

public NumberOfModes ( ) : int
return int

Read() public method

Read the sensor value. The returned value depends on the mode. Distance in proximity mode. Remote command number in remote mode. Beacon location in seek mode.
public Read ( ) : int
return int

ReadAsString() public method

Reads the sensor value as a string.
public ReadAsString ( ) : string
return string

ReadBeaconLocation() public method

Gets the beacon location. This will change the mode to seek
public ReadBeaconLocation ( ) : int
return int

ReadDistance() public method

Read the distance of the sensor in CM (0-100). This will change mode to proximity
public ReadDistance ( ) : int
return int

ReadRaw() public method

Read the sensor value
public ReadRaw ( ) : int
return int

ReadRemoteCommand() public method

Reads commands from the IR-Remote. This will change mode to remote
public ReadRemoteCommand ( ) : byte
return byte

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