C# Class BrickPi.Sensors.NXTColorSensor

Inheritance: INotifyPropertyChanged, ISensor
Show file Open project: Ellerbach/BrickPi Class Usage Examples

Public Methods

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

Initialize a NXT Color Sensor

NXTColorSensor ( BrickPortSensor port, ColorSensorMode mode ) : System

Initialize a NXT Color Sensor

NXTColorSensor ( BrickPortSensor port, ColorSensorMode mode, int timeout ) : System

Initialize a NXT Color Sensor

NumberOfModes ( ) : int
Read ( ) : int

Read the intensity of the reflected or ambient light in percent. In color mode the color index is returned

ReadAsString ( ) : string
ReadColor ( ) : System.Color

Reads the color.

ReadRGBColor ( ) : RGBColor

Reads the color of the RGB.

ReadRaw ( ) : int
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
CalculateRawAverage ( ) : int
CalculateRawAverageAsPct ( ) : int
GetRawValues ( ) : void
OnPropertyChanged ( string name ) : void
StopTimerInternal ( ) : void

Method Details

GetSensorName() public method

public GetSensorName ( ) : string
return string

NXTColorSensor() public method

Initialize a NXT Color Sensor
public NXTColorSensor ( BrickPortSensor port ) : System
port BrickPortSensor Sensor port
return System

NXTColorSensor() public method

Initialize a NXT Color Sensor
public NXTColorSensor ( BrickPortSensor port, ColorSensorMode mode ) : System
port BrickPortSensor Sensor port
mode ColorSensorMode Color mode
return System

NXTColorSensor() public method

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

NumberOfModes() public method

public NumberOfModes ( ) : int
return int

Read() public method

Read the intensity of the reflected or ambient light in percent. In color mode the color index is returned
public Read ( ) : int
return int

ReadAsString() public method

public ReadAsString ( ) : string
return string

ReadColor() public method

Reads the color.
public ReadColor ( ) : System.Color
return System.Color

ReadRGBColor() public method

Reads the color of the RGB.
public ReadRGBColor ( ) : RGBColor
return RGBColor

ReadRaw() public method

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