From afe4885c4c48be0f5d1f8a9d5f13bf5722d5b5c2 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Sun, 4 Sep 2022 15:14:31 +1000 Subject: [PATCH] set value --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.rs b/src/main.rs index 722057f..ea7adb3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -279,4 +279,9 @@ fn main() { }; println!("eeprom: {:#?}", eeprom_data); + let value = 50.; + let value_scaled = ((value / info.v_scale) / f32::powf(2., -15.)) as u16; + // modbus + // .write_register(OffsetsEeprom::EV_soc_g_gy as u16, value_scaled) + // .expect("could not set value"); }