Class Tcs3472x
Represents a Tcs3472x color sensor.
Assembly: Tcs3472x.dll
View Source
public class Tcs3472x : ByteCommsSensorBase<Color>, IObservable<IChangeResult<Color>>, IDisposable, IColorSensor, ISamplingSensor<Color>, ISensor<Color>, ISensor, ISamplingSensor, II2cPeripheral
Inheritance: System.Object
-> Meadow.Foundation.ObservableBase<UNIT>
Implements:
System.IObservable<Meadow.IChangeResult<Meadow.Color>>
, System.IDisposable
, Meadow.Peripherals.Sensors.Color.IColorSensor
, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Color>
, Meadow.Peripherals.Sensors.ISensor<Meadow.Color>
, Meadow.Peripherals.Sensors.ISensor
, Meadow.Peripherals.Sensors.ISamplingSensor
, Meadow.Hardware.II2cPeripheral
Properties
DefaultI2cAddress
Default I2C address for the TCS3472x family.
View Source
public byte DefaultI2cAddress { get; }
IntegrationTime
Gets or sets the integration time for the sensor.
View Source
public double IntegrationTime { get; set; }
CurrentGain
Gets or sets the gain.
View Source
public Tcs3472x.Gain CurrentGain { get; set; }
Color
Gets the last color read from the sensor.
View Source
public Color? Color { get; }
Methods
SetInterrupt(bool)
Sets or clears the colors and clear interrupts.
View Source
public void SetInterrupt(bool state)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | state | True to set all interrupts, false to clear. |
SetInterrupt(InterruptState, bool)
Sets or clears a specific interrupt persistence.
View Source
public void SetInterrupt(Tcs3472x.InterruptState interrupt, bool state)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Foundation.Sensors.Color.Tcs3472x.InterruptState | interrupt | The persistence cycles. |
System.Boolean | state | True to set the interrupt, false to clear. |
GetColor(bool)
Gets the current color reading from the sensor.
View Source
public Task<Color> GetColor(bool delay = true)
Returns
System.Threading.Tasks.Task<Meadow.Color>
: The current color reading.
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | delay | Wait to read the data that the integration time has passed. |
ReadSensor()
Read value from sensor
View Source
protected override Task<Color> ReadSensor()
Returns
System.Threading.Tasks.Task<Meadow.Color>
: unitized value
Implements
System.IObservable<Meadow.IChangeResult<Meadow.Color>>
System.IDisposable
Meadow.Peripherals.Sensors.Color.IColorSensor
Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Color>
Meadow.Peripherals.Sensors.ISensor<Meadow.Color>
Meadow.Peripherals.Sensors.ISensor
Meadow.Peripherals.Sensors.ISamplingSensor
Meadow.Hardware.II2cPeripheral