Crates.io | pid-lite |
lib.rs | pid-lite |
version | 1.2.0 |
source | src |
created_at | 2020-12-24 22:05:14.60976 |
updated_at | 2024-02-05 10:32:55.447602 |
description | A small PID controller library |
homepage | |
repository | https://github.com/yoshuawuyts/pid-lite |
max_upload_size | |
id | 326986 |
size | 32,544 |
$ cargo add pid-lite
use pid_lite::Controller;
use std::thread;
use std::time::Duration;
let target = 80.0;
let mut controller = Controller::new(target, 0.25, 0.01, 0.01);
loop {
let correction = controller.update(measure());
apply_correction(correction);
thread::sleep(Duration::from_secs(1));
}
This crate uses #![deny(unsafe_code)]
to ensure everything is implemented in
100% Safe Rust.
Want to join us? Check out our "Contributing" guide and take a look at some of these issues: