Skip to content

Commit ba9ceaa

Browse files
authored
Add Servo detach implementation (#43)
1 parent 35167d5 commit ba9ceaa

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/output_devices.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,4 +794,14 @@ impl Servo {
794794
pub fn get_frame_width(&mut self) -> u64 {
795795
self.frame_width
796796
}
797+
798+
pub fn detach(&mut self) {
799+
if self
800+
.pin
801+
.clear_pwm()
802+
.is_err()
803+
{
804+
println!("Failed to detach servo")
805+
}
806+
}
797807
}

0 commit comments

Comments
 (0)