Edit

Share via


NXTColorSensor Class

Definition

Create a NXT Color sensor

public class NXTColorSensor : Iot.Device.BrickPi3.Sensors.ISensor, System.ComponentModel.INotifyPropertyChanged
type NXTColorSensor = class
    interface INotifyPropertyChanged
    interface ISensor
Public Class NXTColorSensor
Implements INotifyPropertyChanged, ISensor
Inheritance
NXTColorSensor
Implements

Constructors

NXTColorSensor(Brick, SensorPort)

Initialize a NXT Color Sensor

NXTColorSensor(Brick, SensorPort, ColorSensorMode)

Initialize a NXT Color Sensor

NXTColorSensor(Brick, SensorPort, ColorSensorMode, Int32)

Initialize a NXT Color Sensor

Properties

ColorMode

Color mode

PeriodRefresh

Period to refresh the notification of property changed in milliseconds

Port

Sensor 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

NumberOfModes()

Number of modes supported

Read()

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

ReadAsString()

Reads value from sensor represented as string

ReadColor()

Reads the color.

ReadRaw()

Reads raw value from the sensor

ReadRGBColor()

Reads the color of the RGB.

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