NXTLightSensor Class

Definition

Create a NXT Light sensor

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

Constructors

NXTLightSensor(Brick, SensorPort)

Initialize a NXT Light Sensor

NXTLightSensor(Brick, SensorPort, LightMode)

Initialize a NXT Light Sensor

NXTLightSensor(Brick, SensorPort, LightMode, Int32)

Initialize a NXT Light Sensor

Properties

CutOff

This is used to change the level which indicate if the sensor is on something dark or clear

LightMode

Light 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

ReadAsString()

Reads data from the sensor and coverts it to string

ReadRaw()

Reads raw data from the sensor

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