BMP085 Temperature & Barometer Sensor Driver for Rust
Usage
Add the bmp085 driver to your Cargo.toml
. i2cdev
is also required to use common interfaces:
[dependencies]
bmp085 = "0.1.1"
i2cdev = "*"
Afterwards you can use the sensor:
extern crate bmp085;
extern crate i2cdev;
use *;
use *;
use ;
use thread;
use Duration;
Use cargo build
to build the program, run with sudo target/debug/myprog
.
For device access, root access is commonly required.
Tests
Run cargo tests
on any compatible device/OS and you should see the following
output:
running 6 tests
test tests::test_basic_temp_read ... ok
test tests::test_max_temp_read ... ok
test tests::test_basic_pressure_read ... ok
test tests::test_zero_temp_read ... ok
test tests::test_zero_pressure_read ... ok
test tests::test_rand_temp_read ... ok
test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured
Doc-tests bmp085
running 1 test
test BMP085BarometerThermometer<T>::new_0 ... ignored
test result: ok. 0 passed; 0 failed; 1 ignored; 0 measured
Resources
License
Licensed under Apache 2.0, (c) 2016 Claus Matzinger