This crate provides a Rust driver for the Texas Instruments LM36011 inductorless LED driver.
Add this to your Cargo.toml
file:
[dependencies]
lm36011 = "0.1.0"
use lm36011::LM36011;
// Assume create_i2c_device is a function that initializes and returns an I2C device
use your_hal_crate::create_i2c_device;
fn main() {
let i2c = create_i2c_device();
let mut driver = LM36011::new(i2c);
match driver.set_flash_current(150.0) {
Ok(_) => println!("Flash current set successfully"),
Err(e) => eprintln!("Error setting flash current: {:?}", e),
}
}
The API documentation can be built with cargo doc or viewed online.
This project is licensed under the MIT License - see the LICENSE file for details.
Pull requests are welcome.
ChatGPT 4 assisted in the creation of parts of this code and documentation. It's great for learning new skills!