Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: LSM9DS1 RangeFinder FastPWM
Dependents: PM2_Example_PES_board PM2_Example_PES_board PM2_Example_PES_board PM2_Example_PES_board ... more
Diff: Servo.cpp
- Revision:
- 21:45d903d986f6
- Parent:
- 20:ea222b81350e
- Child:
- 22:13db7047054c
--- a/Servo.cpp Tue Mar 22 09:43:13 2022 +0000
+++ b/Servo.cpp Wed Mar 23 09:30:21 2022 +0000
@@ -50,6 +50,15 @@
}
/**
+ * Re enables the servo with last set angle and period.
+ */
+void Servo::ReEnable()
+{
+ servoEnabled = true;
+ Pulse.attach(callback(this, &Servo::StartPulse), std::chrono::microseconds{static_cast<long int>(Period)});
+}
+
+/**
* Disables the servo.
*/
void Servo::Disable()
