8000 GitHub - mickeprag/ads111x
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mickeprag/ads111x

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ADS111x 16bit ADCs I2C rust driver no_std

Tested on ESP32 and ADS1115 Documentation

Example

let i2c_speed = RateExtU32::kHz(100);

let i2c = I2C::new(peripherals.I2C0, io.pins.gpio19, io.pins.gpio23, i2c_speed, &mut system.peripheral_clock_control, &clocks);

let config = ADS111xConfig::default()
    .mux(ads111x::InputMultiplexer::AIN0GND)
    .dr(ads111x::DataRate::SPS8)
    .pga(ads111x::ProgramableGainAmplifier::V4_096);

let mut adc = match ADS111x::new(i2c, 0x48u8, config){
    Err(e) => panic!("Error {:?}", e),
    Ok(x) => x,
};

match adc.read_single_voltage(None){
    Ok(v) => println!("Val single {:.6}", v),
    Err(e) => println!("Error {:?}", e),
}

License

Licensed under either of:

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%
0