Skip to main content

Class Tcs3472x

Represents a Tcs3472x color sensor.

Assembly: Tcs3472x.dll
View Source
Declaration
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
Declaration
public byte DefaultI2cAddress { get; }

IntegrationTime

Gets or sets the integration time for the sensor.

View Source
Declaration
public double IntegrationTime { get; set; }

CurrentGain

Gets or sets the gain.

View Source
Declaration
public Tcs3472x.Gain CurrentGain { get; set; }

Color

Gets the last color read from the sensor.

View Source
Declaration
public Color? Color { get; }

Methods

SetInterrupt(bool)

Sets or clears the colors and clear interrupts.

View Source
Declaration
public void SetInterrupt(bool state)
Parameters
TypeNameDescription
System.BooleanstateTrue to set all interrupts, false to clear.

SetInterrupt(InterruptState, bool)

Sets or clears a specific interrupt persistence.

View Source
Declaration
public void SetInterrupt(Tcs3472x.InterruptState interrupt, bool state)
Parameters
TypeNameDescription
Meadow.Foundation.Sensors.Color.Tcs3472x.InterruptStateinterruptThe persistence cycles.
System.BooleanstateTrue to set the interrupt, false to clear.

GetColor(bool)

Gets the current color reading from the sensor.

View Source
Declaration
public Task<Color> GetColor(bool delay = true)
Returns

System.Threading.Tasks.Task<Meadow.Color>: The current color reading.

Parameters
TypeNameDescription
System.BooleandelayWait to read the data that the integration time has passed.

ReadSensor()

Read value from sensor

View Source
Declaration
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