Change the way data is displayed
This commit is contained in:
parent
988204d9fa
commit
ef6d8419d7
@ -32,7 +32,7 @@ async fn main(_spawner: Spawner) {
|
||||
loop {
|
||||
unwrap!(twi.blocking_write(ADDRESS, &mut [0xFD]));
|
||||
|
||||
Timer::after_millis(300).await;
|
||||
Timer::after_millis(10).await;
|
||||
|
||||
let mut buf = [0u8; 6];
|
||||
unwrap!(twi.blocking_read(ADDRESS, &mut buf));
|
||||
@ -42,10 +42,9 @@ async fn main(_spawner: Spawner) {
|
||||
|
||||
let rh_int = u16::from_be_bytes([buf[3], buf[4]]);
|
||||
let rh_float: f32 = -6f32 + 125f32 * (rh_int as f32 / (2u32.pow(16) - 1) as f32);
|
||||
println!("temp_float: {}", temp_float);
|
||||
println!("rh_float: {}", rh_float);
|
||||
println!("{}\t{}", temp_float, rh_float);
|
||||
|
||||
Timer::after_millis(1000).await;
|
||||
Timer::after_millis(50).await;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user