Skip to content

Commit a460922

Browse files
committed
hts221 setup changes
1 parent 5ec827f commit a460922

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use std::sync::Mutex;
1414
use bno055::{mint, BNO055PowerMode};
1515
use embedded_hal_bus::i2c::MutexDevice;
1616
use embedded_hal_compat::Reverse;
17+
use hts221::UpdateMode::Block;
1718

1819
const RFD_PATH: &str = "/dev/ttyAMA2";
1920
const RFD_BAUD: u32 = 57600;
@@ -354,7 +355,7 @@ async fn bno055_loop(data: watch::Sender<Option<mint::Quaternion<f32>>>, i2c: Mu
354355
#[instrument(skip_all)]
355356
async fn hts221_loop(data: watch::Sender<Option<f64>>, i2c: MutexDevice<'_, I2cdev>) {
356357
let mut i2c = Reverse::new(i2c);
357-
let mut hts221 = hts221::Builder::new().with_data_rate(hts221::DataRate::Continuous1Hz).build(&mut i2c).unwrap();
358+
let mut hts221 = hts221::Builder::new().with_update_mode(Block).with_data_rate(hts221::DataRate::Continuous1Hz).with_boot().build(&mut i2c).unwrap();
358359

359360
loop {
360361
sleep(Duration::from_millis(50)).await;

0 commit comments

Comments
 (0)