{"id":16064651,"url":"https://github.com/eldruin/veml6030-rs","last_synced_at":"2025-08-24T13:43:46.795Z","repository":{"id":57671556,"uuid":"210534182","full_name":"eldruin/veml6030-rs","owner":"eldruin","description":"Platform-agnostic Rust driver for the VEML6030 and VEML7700 high-accuracy ambient light sensors.","archived":false,"fork":false,"pushed_at":"2021-09-06T12:49:04.000Z","size":63,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-16T05:27:49.606Z","etag":null,"topics":["als","ambient-light-sensor","embedded","embedded-hal-driver","i2c","light-sensor","rust","vishay"],"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/eldruin.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}},"created_at":"2019-09-24T07:00:56.000Z","updated_at":"2024-07-12T09:42:38.000Z","dependencies_parsed_at":"2022-09-13T13:03:16.904Z","dependency_job_id":null,"html_url":"https://github.com/eldruin/veml6030-rs","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fveml6030-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fveml6030-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fveml6030-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eldruin%2Fveml6030-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eldruin","download_url":"https://codeload.github.com/eldruin/veml6030-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243902813,"owners_count":20366355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["als","ambient-light-sensor","embedded","embedded-hal-driver","i2c","light-sensor","rust","vishay"],"created_at":"2024-10-09T05:08:59.924Z","updated_at":"2025-08-24T13:43:46.766Z","avatar_url":"https://github.com/eldruin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust VEML6030/VEML7700 High Accuracy Ambient Light Sensor Driver\n\n[![crates.io](https://img.shields.io/crates/v/veml6030.svg)](https://crates.io/crates/veml6030)\n[![Docs](https://docs.rs/veml6030/badge.svg)](https://docs.rs/veml6030)\n![MSRV](https://img.shields.io/badge/rustc-1.75+-blue.svg)\n[![Build Status](https://github.com/eldruin/veml6030-rs/workflows/Build/badge.svg)](https://github.com/eldruin/veml6030-rs/actions?query=workflow%3ABuild)\n[![Coverage Status](https://coveralls.io/repos/github/eldruin/veml6030-rs/badge.svg?branch=master)](https://coveralls.io/github/eldruin/veml6030-rs?branch=master)\n\nThis is a platform agnostic Rust driver for the VEML6030 and VEML7700 high accuracy ambient\nlight sensors using the [`embedded-hal`] traits.\n\nThis driver allows you to:\n- Enable/disable the device. See: `enable()`.\n- Read the measured lux value. See: `read_lux()`.\n- Read the white channel measurement. See: `read_white()`.\n- Read the measured ALS value in raw format. See: `read_raw()`.\n- Calculate the compensated lux for a raw ALS value. See: `convert_raw_als_to_lux()`.\n- Set the gain. See: `set_gain()`.\n- Set the integration time. See: `set_integration_time()`.\n- Set the fault count. See: `set_fault_count()`.\n- Enable/disable and configure power saving mode. See: `enable_power_saving()`.\n- Enable/disable interrupts. See: `enable_interrupts()`.\n- Read the interrupt status. See: `read_interrupt_status()`.\n- Set the high/low thresholds in lux or raw. See: `set_high_threshold_lux()`.\n- Calculate the compensated raw threshold value ahead of time. See: `calculate_raw_threshold_value()`.\n\n[Introductory blog post](https://blog.eldruin.com/veml6030-ambient-light-sensor-driver-in-rust/)\n\n## The devices\n\nVishay's VEML6030 and VEML7700 are high accuracy ambient light digital 16-bit\nresolution sensors in a miniature transparent package. They include\na high sensitive photodiode, a low noise amplifier, a 16-bit A/D converter\nand support an easy to use I2C bus communication interface and additional\ninterrupt feature.\nThe ambient light result is as digital value available.\n\nDatasheets: [VEML6030](https://www.vishay.com/docs/84366/veml6030.pdf) - [VEML7700](https://www.vishay.com/docs/84286/veml7700.pdf)\n\nApplication Notes:\n- [Designing the VEML6030 into an application](https://www.vishay.com/docs/84367/designingveml6030.pdf)\n- [Designing the VEML7700 into an application](https://www.vishay.com/docs/84323/designingveml7700.pdf)\n\n## Usage\n\nTo use this driver, import this crate and an `embedded_hal` implementation,\nthen instantiate the device.\n\nVEML6030 and VEML7700 expose the same interface over I2C. To communicate with a VEML7700\nsimply use this driver as if communicating with a VEML6030.\n\nPlease find additional examples using hardware in this repository: [driver-examples]\n\n[driver-examples]: https://github.com/eldruin/driver-examples\n\n```rust\nuse linux_embedded_hal::I2cdev;\nuse veml6030::{SlaveAddr, Veml6030};\n\nfn main() {\n    let dev = I2cdev::new(\"/dev/i2c-1\").unwrap();\n    let address = SlaveAddr::default();\n    let mut sensor = Veml6030::new(dev, address);\n    sensor.enable().unwrap();\n    loop {\n        let lux = sensor.read_lux().unwrap();\n        println!(\"lux: {:2}\", lux);\n    }\n}\n```\n\n## Support\n\nFor questions, issues, feature requests, and other changes, please file an\n[issue in the github project](https://github.com/eldruin/veml6030-rs/issues).\n\n## Minimum Supported Rust Version (MSRV)\n\nThis crate is guaranteed to compile on stable Rust 1.75 and up. It *might*\ncompile with older versions but that may change in any new patch release.\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[`embedded-hal`]: https://github.com/rust-embedded/embedded-hal\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldruin%2Fveml6030-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feldruin%2Fveml6030-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feldruin%2Fveml6030-rs/lists"}