{"id":43721833,"url":"https://github.com/rust-embedded-community/tcs3400-rs","last_synced_at":"2026-02-05T08:11:08.872Z","repository":{"id":63319955,"uuid":"566997149","full_name":"rust-embedded-community/tcs3400-rs","owner":"rust-embedded-community","description":"Platform-agnostic Rust driver for the TCS3400 RGB color light to digital converter with IR filter ","archived":false,"fork":false,"pushed_at":"2024-01-10T10:23:16.000Z","size":13,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-06T13:53:46.510Z","etag":null,"topics":["color","driver","embedded","embedded-hal","embedded-hal-driver","i2c","no-std","rgb","rust","sensor"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-embedded-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-11-16T21:15:38.000Z","updated_at":"2022-11-17T21:06:27.000Z","dependencies_parsed_at":"2024-01-10T11:37:52.905Z","dependency_job_id":null,"html_url":"https://github.com/rust-embedded-community/tcs3400-rs","commit_stats":null,"previous_names":["andresv/tcs3400-rs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rust-embedded-community/tcs3400-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded-community%2Ftcs3400-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded-community%2Ftcs3400-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded-community%2Ftcs3400-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded-community%2Ftcs3400-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-embedded-community","download_url":"https://codeload.github.com/rust-embedded-community/tcs3400-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-embedded-community%2Ftcs3400-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29116453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T05:31:32.482Z","status":"ssl_error","status_checked_at":"2026-02-05T05:31:29.075Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["color","driver","embedded","embedded-hal","embedded-hal-driver","i2c","no-std","rgb","rust","sensor"],"created_at":"2026-02-05T08:11:08.011Z","updated_at":"2026-02-05T08:11:08.867Z","avatar_url":"https://github.com/rust-embedded-community.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust TCS3400 RGB Color Light to Digital Converter with IR Filter Driver\n\n[![crates.io](https://img.shields.io/crates/v/tcs3400.svg)](https://crates.io/crates/tcs3400)\n[![Docs](https://docs.rs/tcs3400/badge.svg)](https://docs.rs/tcs3400)\n[![Build Status](https://github.com/andresv/tcs3400-rs/workflows/Build/badge.svg)](https://github.com/andresv/tcs3400-rs/actions?query=workflow%3ABuild)\n[![Coverage Status](https://coveralls.io/repos/github/andresv/tcs3400-rs/badge.svg?branch=master)](https://coveralls.io/github/andresv/tcs3400-rs?branch=master)\n\nThis is a platform agnostic Rust driver for the TCS3400 RGB color light to\ndigital converter with IR filter, based on the [`embedded-hal`] traits.\n\n[`embedded-hal`]: https://github.com/rust-embedded/embedded-hal\n\nThis driver allows you to:\n- Enable/disable the device.\n- Enable/disable the RGB converter.\n- Set RGB converter gain.\n- Enable/disable the RGB converter interrupt generation.\n- Set the RGB converter interrupt clear channel low/high thresholds.\n- Set the RGB converter interrupt persistence.\n- Set the number of integration cycles.\n- Enable/disable the wait feature.\n- Set the number of wait time cycles.\n- Enable/disable the *wait long* setting.\n- Read status of RGB converter.\n- Read the clear (unfiltered) channel measurement.\n- Read the red channel measurement.\n- Read the green channel measurement.\n- Read the blue channel measurement.\n- Read the measurement of all channels at once.\n- Read the device ID.\n\n## The device\nThe TCS3400 device provides a digital return of red, green, blue (RGB), and\nclear light sensing values. An IR blocking filter, integrated on-chip and\nlocalized to the color sensing photodiodes, minimizes the IR spectral\ncomponent of the incoming light and allows color measurements to be made\naccurately. The high sensitivity, wide dynamic range, and IR blocking\nfilter make the TCS3400 an ideal color sensor solution for use under\nvarying lighting conditions and through attenuating materials.\n\nThe TCS3400 color sensor has a wide range of applications including RGB LED\nbacklight control, solid-state lighting, health/fitness products,\nindustrial process controls and medical diagnostic equipment. In addition,\nthe IR blocking filter enables the TCS3400 to perform ambient light sensing\n(ALS). Ambient light sensing is widely used in display-based products such\nas cell phones, notebooks, and TVs to sense the lighting environment and\nenable automatic display brightness for optimal viewing and power savings.\nThe TCS3400, itself, can enter a lower-power wait state between light\nsensing measurements to further reduce the average power consumption.\n\nDatasheet:\n- [TCS3400](https://ams.com/documents/20143/36005/TCS3400_DS000411_5-00.pdf)\n\nThis driver is compatible with the devices TCS34005 and TCS34007.\n\n## Usage\n\nTo use this driver, import this crate and an `embedded_hal` implementation,\nthen instantiate the device.\n\n```rust\nuse linux_embedded_hal::I2cdev;\nuse tcs3400::Tcs3400;\n\nfn main() {\n    let dev = I2cdev::new(\"/dev/i2c-1\").unwrap();\n    let mut sensor = Tcs3400::new(dev);\n    sensor.enable().unwrap();\n    sensor.enable_rgbc().unwrap();\n    while !sensor.is_rgbc_status_valid().unwrap() {\n        // wait for measurement to be available\n    }\n    let m = sensor.read_all_channels().unwrap();\n    println!(\n        \"Measurements: clear = {}, red = {}, green = {}, blue = {}\",\n        m.clear, m.red, m.green, m.blue\n    );\n}\n```\n\n## Minimum Supported Rust Version (MSRV)\n\nThis crate is guaranteed to compile on stable Rust 1.31.0 and up. It *might*\ncompile with older versions but that may change in any new patch release.\n\n## Support\n\nFor questions, issues, feature requests, and other changes, please file an\n[issue in the github project](https://github.com/andresv/tcs3400-rs/issues).\n\n## License\n\nLicensed under either of:\n\n * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contributing\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-embedded-community%2Ftcs3400-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-embedded-community%2Ftcs3400-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-embedded-community%2Ftcs3400-rs/lists"}