From 23f9edbe7988f274635e07e1fa48d22790506371 Mon Sep 17 00:00:00 2001
From: Samuel Tardieu <sam@rfc1149.net>
Date: Sat, 21 Sep 2024 13:59:49 +0200
Subject: [PATCH] Add `Controller::standby()` method

---
 tele0592/src/controller.rs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tele0592/src/controller.rs b/tele0592/src/controller.rs
index 79f71f0..a368407 100644
--- a/tele0592/src/controller.rs
+++ b/tele0592/src/controller.rs
@@ -198,6 +198,14 @@ pub trait Controller: Device {
         }
     }
 
+    /// Put both motors in standby mode.
+    ///
+    /// # Errors
+    /// This method may fail if the communication with the board fails.
+    fn standby(&mut self) -> Result<(), Self::I2cError> {
+        self.set_raw_motor_speed(None, None)
+    }
+
     /// Set the left and right motor speeds. The speed will be controlled
     /// using the internal PID.
     ///
-- 
GitLab