Edit

Share via


EV3InfraredSensor Class

Definition

Create a EV3 Infrared Sensor

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

Constructors

EV3InfraredSensor(Brick, SensorPort)

Initialize an EV3 IR Sensor

EV3InfraredSensor(Brick, SensorPort, IRMode)

Initializes an EV3 IS Sensor

EV3InfraredSensor(Brick, SensorPort, IRMode, Int32)

Initialize an EV3 IR Sensor

Properties

Channel

Gets or sets the IR channel used for reading remote commands or beacon location

Mode

Gets or sets the IR 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 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()

Reads the sensor value as a string.

ReadBeaconLocation()

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

ReadDistance()

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

ReadRaw()

Read the sensor value

ReadRemoteCommand()

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

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