Changed over to async functions
changed over all the classes in these files to use async based methods rather than non. This SHOULD make the system more reliable with embassy in the future, and hopefully prevent issues with blocking code and the way embassy works.
This commit is contained in:
@@ -61,7 +61,7 @@ impl PID {
|
||||
///Will output a float between -1.0 and 1.0
|
||||
///Current value is the current "position" of the system NOT the goal
|
||||
/// Use set_point() method to change the "goal position" for the system
|
||||
pub fn pid_step(&mut self, current_value: f32) -> f32 {
|
||||
pub async fn pid_step(&mut self, current_value: f32) -> f32 {
|
||||
//If the values
|
||||
let error = self.set_point - current_value;
|
||||
|
||||
@@ -117,7 +117,7 @@ impl PID {
|
||||
return self.output;
|
||||
}
|
||||
|
||||
pub fn set_point(&mut self, set_point: f32) {
|
||||
pub async fn set_point(&mut self, set_point: f32) {
|
||||
if set_point != self.set_point {
|
||||
//Update all internal fields
|
||||
self.integral = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user