ColorAndDistanceSensor 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.
Color and distance sensor.
public class ColorAndDistanceSensor : Iot.Device.BuildHat.Sensors.ColorSensor
type ColorAndDistanceSensor = class
inherit ColorSensor
Public Class ColorAndDistanceSensor
Inherits ColorSensor
- Inheritance
Constructors
ColorAndDistanceSensor(Brick, SensorPort) |
Creates a color and distance sensor. |
Properties
AmbiantLight |
Gets the ambiant light. (Inherited from ColorSensor) |
BaudRate |
Baud rate the sensor is connected (Inherited from ActiveSensor) |
Color |
Gets the last measured Color (Inherited from ColorSensor) |
CombiModes |
Gets the possible combi modes. Note, is will be empty if none. (Inherited from ActiveSensor) |
Counter |
Gets the counter of cumulated object detected. |
Distance |
Gets the distance from the object |
HardwareVersion |
Hardware version (Inherited from ActiveSensor) |
IsColorDetected |
Gets true if a color is detected. (Inherited from ColorSensor) |
IsConnected |
Gets true if the sensor is connected. (Inherited from Sensor) |
ModeDetails |
Gets the mode details of the sensor. (Inherited from ActiveSensor) |
NumberOfModes |
Numbers the of modes. (Inherited from ActiveSensor) |
Port |
Gets the Sensor port (Inherited from Sensor) |
PositionPid |
Gets the recommended Speed PID settings (Inherited from ActiveSensor) |
ReflectedLight |
Gets the reflected light. (Inherited from ColorSensor) |
SensorName |
Gets the name of the sensor. |
SensorType |
Gets the sensor type (Inherited from Sensor) |
SoftwareVersion |
Software version (Inherited from ActiveSensor) |
SpeedPid |
Gets the recommended Speed PID settings (Inherited from ActiveSensor) |
ValuesAsString |
Property to return the raw value of the sensort as a string. It will contains as the first elements PxCy. x = the port number, y = 0 for continuous reading, 1 for single reading. The rest are the measures. (Inherited from ActiveSensor) |
Methods
GetAmbiantLight() |
Gets the ambiant light. (Inherited from ColorSensor) |
GetColor() |
Gets the color, measure the nulmber of setup times. (Inherited from ColorSensor) |
GetCounter() |
Gets the the counter of cumulated object detected. |
GetDistance() |
Gets the distance of the object from 0 to +10 cm |
GetReflectedLight() |
Gets the reflected component. (Inherited from ColorSensor) |
OnPropertyChanged(String) |
Raises the on property changed event. (Inherited from Sensor) |
OnPropertyUpdated(String) |
Raises the on property updated event. (Inherited from Sensor) |
SelectCombiModesAndRead(Int32[], Boolean) |
Returned the name of the selectd mode (Inherited from ActiveSensor) |
SelectModeAndRead(Int32, Boolean) |
Returned the name of the selectd mode (Inherited from ActiveSensor) |
StopReading() |
Stop reading continuous data from a specific sensor. (Inherited from ActiveSensor) |
SwitchOff(SensorPort) |
Switches a sensor off. (Inherited from ActiveSensor) |
SwitchOn() |
Switches a sensor on. (Inherited from ActiveSensor) |
WriteBytes(ReadOnlySpan<Byte>, Boolean) |
Writes directly to the sensor. The bytes to the current port, the first one or two bytes being header bytes. The message is padded if necessary, and length and checksum fields are automatically populated. (Inherited from ActiveSensor) |
Events
PropertyChanged |
To notify a property has changed. It means the value has changed. (Inherited from Sensor) |
PropertyUpdated |
To notify a property has been updated. It means the property has been updated regardeless of a change in its value. (Inherited from Sensor) |
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