Add fan test module

This commit is contained in:
2026-03-26 10:37:34 +01:00
parent b76c65a56d
commit f1a018ce35

View File

@@ -0,0 +1,24 @@
use std::thread;
use std::time::Duration;
use rppal::gpio::Gpio;
let gpio = Gpio::new()?;
let mut fanFiveVoltRail = gpio.get(2)?.into_output();
// Quick toggle fans 5 seconds long, 0.5s interval
let mut i = 0;
while i < 11 {
fanFiveVoltRail.set_high();
thread::sleep(Duration::from_secs(0.5));
fanFiveVoltRail.set_low();
i = i + 1
}
// Run fans for five more seconds constant
fanFiveVoltRail.set_high();
thread::sleep(Duration::from_secs(5));
fanFiveVoltRail.set_low();