KX5NNDAFKJ7JQZWZ7OIQJ7VOCW2VVBPN3LPFJE2M5VBR4SHJJVQQC
NMXPDJT64FJ6F44C5Y7KH3O2PKO5J3GFISW65PG7FXUUVUHIVQEAC
4RCKTWVFPUOKIWGH2SQTIO7RMNTRHOZLI4ZP4J67ZNZUOFGBFRMQC
HLUZ7QUVMCB4THRXBCW5RNTI463RYY4NLOTQHWTOWFLLA7IIWSGAC
36RVLNYE36UUJ6DYRNVVE4UEQ4YPQPRF645R5TB3P4TSQVWD3YPAC
NG5575BUYXRCGNLILP3O5AYDTU5EXMD2QCTEVK7SCK6DTCVQTHQQC
#![warn(clippy::pedantic)]
const R_SMALLEST: u32 = 99;
use ufmt::uwriteln;
#[cfg(debug_assertions)]
let mut relay3 = pins.d4.into_output();
log!("r1 = {}", r1); relay1.set_high(); relay2.set_high(); arduino_hal::delay_ms(1000); } else if r1.abs_diff(average) > R_SMALLEST.abs_diff(average) { log!( "{} > {}", r1.abs_diff(average), R_SMALLEST.abs_diff(average) ); log!("Switching to smallest resistance."); r1 = R_SMALLEST;
log!("r1 = {}", r1);
relay1.set_high();
relay2.set_high();
arduino_hal::delay_ms(1000);
} else if r1.abs_diff(average) > R_SMALLEST.abs_diff(average) {
log!(
"{} > {}",
r1.abs_diff(average),
R_SMALLEST.abs_diff(average)
);
log!("Switching to smallest resistance.");
r1 = R_SMALLEST;
relay3.set_high();
relay3.set_low();