main: use temperature as PID input

This commit is contained in:
Astro 2019-10-03 01:35:37 +02:00
parent 420be00407
commit cc5c21e088

View File

@ -263,7 +263,7 @@ fn main() -> ! {
let temperature = state.sh.get_temperature(voltage); let temperature = state.sh.get_temperature(voltage);
if state.pid_enabled { if state.pid_enabled {
let width = state.pid.update(data as f32) as u16; let width = state.pid.update(temperature) as u16;
match channel { match channel {
0 => tec0.set(TecPin::ISet, width, PWM_PID_WIDTH), 0 => tec0.set(TecPin::ISet, width, PWM_PID_WIDTH),
1 => tec1.set(TecPin::ISet, width, PWM_PID_WIDTH), 1 => tec1.set(TecPin::ISet, width, PWM_PID_WIDTH),