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.
Revision 3:1d16a22386a8, committed 2015-06-27
- Comitter:
- ikrase
- Date:
- Sat Jun 27 06:37:14 2015 +0000
- Parent:
- 2:f982504e6e84
- Child:
- 4:32fa20b74c9c
- Commit message:
- Started work on specified timeout.
Changed in this revision
--- a/PolyServo.cpp Sat Jun 27 06:08:17 2015 +0000
+++ b/PolyServo.cpp Sat Jun 27 06:37:14 2015 +0000
@@ -3,6 +3,7 @@
#include "mbed.h"
#include "FPointer.h"
#include <vector>
+#include "SpecifiedTimeout.h"
Polyservo::Polyservo(DigitalOut servo_pins[], int num_pins): numservos(num_pins) {
@@ -26,8 +27,10 @@
void Polyservo::servos_reset(void){
for(int i=0; i< numservos; i++) {
if (global_enable && positions[i] != SERVO_DISABLED){
-
-
+ servos[i]->write(1);
+ servo_timers[i]->attach_us(this,&Polyservo::servo_set,positions[i]);
+ } else {
+ servos[i]->write(0);
}
}
--- a/PolyServo.h Sat Jun 27 06:08:17 2015 +0000 +++ b/PolyServo.h Sat Jun 27 06:37:14 2015 +0000 @@ -4,6 +4,7 @@ #include "mbed.h" #include "FPointer.h" #include <vector> +#include "SpecifiedTimeout.h" #define SERVO_DISABLED -1 // This is going to take raw servo microsecond entries.