Thermocouple type k conversion updates.
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user