nanoFramework.Iot.Device.Tcs3472x 1.2.864

Prefix Reserved
dotnet add package nanoFramework.Iot.Device.Tcs3472x --version 1.2.864
                    
NuGet\Install-Package nanoFramework.Iot.Device.Tcs3472x -Version 1.2.864
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="nanoFramework.Iot.Device.Tcs3472x" Version="1.2.864" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="nanoFramework.Iot.Device.Tcs3472x" Version="1.2.864" />
                    
Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.Tcs3472x" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add nanoFramework.Iot.Device.Tcs3472x --version 1.2.864
                    
#r "nuget: nanoFramework.Iot.Device.Tcs3472x, 1.2.864"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package nanoFramework.Iot.Device.Tcs3472x@1.2.864
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=nanoFramework.Iot.Device.Tcs3472x&version=1.2.864
                    
Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.Tcs3472x&version=1.2.864
                    
Install as a Cake Tool

TCS3472x/TCS34721/TCS34723/TCS34725/TCS34727 Sensors

TCS3472x sensors are color I2C sensors.

Documentation

Device Family contains TCS34721, TCS34723, TCS34725 and TCS34727.

You will find this device as "RGB Color Sensor with IR filter and White LED - TCS34725"

Note: TCS34721 and TCS34723 have a default I2C address which is 0x39 while TCS34725 and TCS34727 have 0x29.

Board

image

Usage

Create a Tcs3472xSensor class and pass the I2C device. Please see above for the default address depending on the chip you are using. The default one provided in the class is for the most popular ones so TCS34725 and TCS34727.

var i2cSettings = new I2cConnectionSettings(1, Tcs3472xSensor.DefaultAddress);
I2cDevice i2cDevice = I2cDevice.Create(i2cSettings);
Tcs3472xSensor tcs3472X = new Tcs3472xSensor(i2cDevice);
while(!Console.KeyAvailable)
{
    Console.WriteLine($"ID: {tcs3472X.ChipId} Gain: {tcs3472X.Gain} Time to wait: {tcs3472X.IntegrationTime}");
    var col = tcs3472X.GetColor();
    Console.WriteLine($"R: {col.R} G: {col.G} B: {col.B} A: {col.A} Color: {col.Name}");
    Console.WriteLine($"Valid data: {tcs3472X.IsValidData} Clear Interrupt: {tcs3472X.IsClearInterrupt}");
    Thread.Sleep(1000);
}

You can as well adjust the time for integration, so the time needed to read the data either in the constructor either later one. Minimum time is 0.0024 seconds and maximum time is 7.4 seconds. This is not a linear function and it will be set to the closest lower value supported by the chip.

when calling tcs3472X.GetColor() you get a Color type with RGB as the normal RGB. A contains the Clear value of the sensor.

Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.864 204 4/2/2025
1.2.852 183 3/11/2025
1.2.822 140 2/26/2025
1.2.775 144 2/4/2025
1.2.772 130 2/4/2025
1.2.755 138 1/31/2025
1.2.737 120 1/13/2025
1.2.704 145 12/18/2024
1.2.696 146 12/16/2024
1.2.673 133 10/23/2024
1.2.665 130 10/16/2024
1.2.651 145 9/27/2024
1.2.631 156 8/28/2024
1.2.590 147 7/17/2024
1.2.580 145 6/28/2024
1.2.570 142 6/14/2024
1.2.548 130 5/15/2024
1.2.436 326 11/10/2023
1.2.416 156 11/8/2023
1.2.329 247 5/26/2023
1.2.316 231 5/16/2023
1.2.313 229 5/12/2023
1.2.308 238 5/11/2023
1.2.304 208 5/10/2023
1.2.297 240 5/3/2023
1.2.217 415 1/6/2023
1.2.212 398 1/5/2023
1.2.203 397 12/28/2022
1.2.159 465 11/14/2022
1.2.153 461 11/5/2022
1.2.141 473 10/25/2022
1.2.125 504 10/12/2022
1.2.87 583 9/15/2022
1.2.82 571 9/14/2022
1.1.118.19693 552 6/24/2022
1.1.116.8772 535 6/24/2022
1.1.97.17326 533 6/13/2022
1.1.92.53000 532 6/8/2022
1.1.58.10097 551 5/23/2022
1.1.3 568 4/15/2022
1.1.1 532 4/14/2022
1.0.300 558 4/3/2022
1.0.288-preview.114 195 3/25/2022
1.0.288-preview.113 186 3/25/2022
1.0.288-preview.110 187 3/25/2022
1.0.288-preview.104 187 3/22/2022
1.0.288-preview.100 196 3/19/2022
1.0.288-preview.48 226 2/4/2022
1.0.288-preview.22 209 1/27/2022
1.0.288-preview.20 220 1/27/2022
1.0.288-preview.18 209 1/27/2022
1.0.272 620 1/10/2022
1.0.260 443 12/10/2021
1.0.259 437 12/9/2021
1.0.230 504 10/27/2021
1.0.228 489 10/26/2021