#light-sensor #sensor #light #i2c #embedded-hal-driver #tsl2591

tsl2591-eh-driver

Rust embedded-hal driver for the TSL2591 Light Sensor

4 releases (2 breaking)

0.5.1 Sep 17, 2024
0.5.0 Feb 21, 2024
0.4.0 Dec 1, 2023
0.3.0 Jul 7, 2023

#1065 in Embedded development

Download history 2/week @ 2024-06-27 3/week @ 2024-07-04 8/week @ 2024-07-25 2/week @ 2024-08-01 125/week @ 2024-09-12 39/week @ 2024-09-19 19/week @ 2024-09-26 10/week @ 2024-10-03

193 downloads per month

MIT/Apache

13KB
258 lines

Forked from https://github.com/pcvonz/tsl2591-rs.

TSL2591 driver

A WIP Rust implementation of the TSL2591 High Dynamic Range Digital Light Sensor.

Most of what's here is a straight port of the Adafruit C++ library.

Features

  • Basic reading and lux calculation
  • Interrupt support

Usage

t.enable().unwrap();
loop {
    let (ch_0, ch_1) = t.get_channel_data().unwrap();
    delay.delay_ms(200); // wait for sensor to integrate data
    let d = t.calculate_lux(ch_0, ch_1).unwrap();
    println!("Counts {}", d);
}

License

license

This tool is released under the MIT license, hence allowing commercial use of the library. Please refer to the LICENSE file.

Dependencies

~105KB