EV3ColorSensor Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Create a EV3 Color sensor
public class EV3ColorSensor : Iot.Device.BrickPi3.Sensors.ISensor, System.ComponentModel.INotifyPropertyChanged
type EV3ColorSensor = class
interface INotifyPropertyChanged
interface ISensor
Public Class EV3ColorSensor
Implements INotifyPropertyChanged, ISensor
- Inheritance
-
EV3ColorSensor
- Implements
Constructors
EV3ColorSensor(Brick, SensorPort) |
Initialize an EV3 Color Sensor |
EV3ColorSensor(Brick, SensorPort, ColorSensorMode) |
Initialize an EV3 Color Sensor |
EV3ColorSensor(Brick, SensorPort, ColorSensorMode, Int32) |
Initilaize an EV3 Color Sensor |
Properties
ColorMode |
Set or get the 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 |
Read() |
Read the intensity of the reflected or ambient light in percent. In color mode the color index is returned |
ReadAsString() |
Get the color as a string |
ReadColor() |
Reads the color. |
ReadRaw() |
Get the raw value |
ReadRGBColor() |
Reads the color of the RGB. |
ReadTest() |
Read the test value |
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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for