From 94e0525002b57185980a4db105ddbad651f02352 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 17 Sep 2020 01:20:31 +0200 Subject: [PATCH] tec_u_meas: subtract vref offset --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index b650e84..0e915d9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -187,7 +187,7 @@ fn main() -> ! { vref.into_format_args(volt, Abbreviation), dac_feedback.into_format_args(volt, Abbreviation), itec.into_format_args(volt, Abbreviation), tec_i.into_format_args(ampere, Abbreviation), tec_u_meas.into_format_args(volt, Abbreviation), - (tec_u_meas / tec_i).into_format_args(ohm, Abbreviation), + ((tec_u_meas - vref) / tec_i).into_format_args(ohm, Abbreviation), ); } else { let _ = writeln!(socket, "channel {}: no adc input", channel); @@ -269,7 +269,7 @@ fn main() -> ! { match (state.get_adc(), state.get_sens(), state.get_temperature()) { (Some(adc), Some(sens), Some(temp)) => { let _ = writeln!( - socket, "- adc={:.6} r={:.0} temp{}={:.3}K", + socket, "- adc={:.6} r={:.0} temp{}={:.3}", adc.into_format_args(volt, Abbreviation), sens.into_format_args(ohm, Abbreviation), channel,