Thermocouple type k conversion updates.

This commit is contained in:
Zachary Sunforge
2023-07-14 22:45:59 -07:00
parent abde12a8ba
commit 45bc1707e9
2 changed files with 54 additions and 22 deletions

View File

@ -91,12 +91,7 @@ async fn main(spawner: Spawner) {
// Zero test
let zero_voltage = f32::ElectricPotential::new::<millivolt>(0.0);
let zero_temperature = thermocouple_k::convert(
zero_voltage,
reference_temp,
thermocouple_k::r_junction_offset_lin,
)
.unwrap();
let zero_temperature = thermocouple_k::convert_direct(zero_voltage, reference_temp).unwrap();
let zero_celsius = zero_temperature.get::<degree_celsius>();
info!("Zero test: {}", zero_celsius);
@ -108,9 +103,7 @@ async fn main(spawner: Spawner) {
.unwrap()
.to_voltage(AUTOCAL_CONF.ad_control.gain());
let mv = voltage.get::<millivolt>();
let temperature =
thermocouple_k::convert(voltage, reference_temp, thermocouple_k::r_junction_offset_lin)
.unwrap();
let temperature = thermocouple_k::convert_direct(voltage, reference_temp).unwrap();
let celsius = temperature.get::<degree_celsius>();
info!("Temperature in degrees celsius: {}, millivolts: {}", celsius, mv);
}