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.
PolyServo.h@0:6105cf98b610, 2015-06-26 (annotated)
- Committer:
- ikrase
- Date:
- Fri Jun 26 08:23:05 2015 +0000
- Revision:
- 0:6105cf98b610
- Child:
- 1:1135f0b1566e
First library-specific commit. Constructor mostly done.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ikrase | 0:6105cf98b610 | 1 | #ifndef POLYSERVO_H |
| ikrase | 0:6105cf98b610 | 2 | #define POLYSERVO_H |
| ikrase | 0:6105cf98b610 | 3 | |
| ikrase | 0:6105cf98b610 | 4 | #include "mbed.h" |
| ikrase | 0:6105cf98b610 | 5 | #include <vector> |
| ikrase | 0:6105cf98b610 | 6 | |
| ikrase | 0:6105cf98b610 | 7 | |
| ikrase | 0:6105cf98b610 | 8 | #define SERVO_DISABLED -1 // This is going to take raw servo microsecond entries. |
| ikrase | 0:6105cf98b610 | 9 | #define SERVO_PPM_PERIOD 20000 // In microseconds |
| ikrase | 0:6105cf98b610 | 10 | |
| ikrase | 0:6105cf98b610 | 11 | class Polyservo { |
| ikrase | 0:6105cf98b610 | 12 | public: |
| ikrase | 0:6105cf98b610 | 13 | |
| ikrase | 0:6105cf98b610 | 14 | std::vector<DigitalOut *> servos; |
| ikrase | 0:6105cf98b610 | 15 | //DigitalOut * servos; |
| ikrase | 0:6105cf98b610 | 16 | |
| ikrase | 0:6105cf98b610 | 17 | bool global_enable; |
| ikrase | 0:6105cf98b610 | 18 | int position[]; |
| ikrase | 0:6105cf98b610 | 19 | int numservos; |
| ikrase | 0:6105cf98b610 | 20 | |
| ikrase | 0:6105cf98b610 | 21 | Polyservo(DigitalOut servo_pins[], int num_pins); |
| ikrase | 0:6105cf98b610 | 22 | void set_position(int pos); |
| ikrase | 0:6105cf98b610 | 23 | |
| ikrase | 0:6105cf98b610 | 24 | |
| ikrase | 0:6105cf98b610 | 25 | |
| ikrase | 0:6105cf98b610 | 26 | |
| ikrase | 0:6105cf98b610 | 27 | |
| ikrase | 0:6105cf98b610 | 28 | private: |
| ikrase | 0:6105cf98b610 | 29 | |
| ikrase | 0:6105cf98b610 | 30 | Ticker period_tick; |
| ikrase | 0:6105cf98b610 | 31 | std::vector<Timeout *> servo_times; |
| ikrase | 0:6105cf98b610 | 32 | //Timeout * servo_times; |
| ikrase | 0:6105cf98b610 | 33 | |
| ikrase | 0:6105cf98b610 | 34 | |
| ikrase | 0:6105cf98b610 | 35 | |
| ikrase | 0:6105cf98b610 | 36 | |
| ikrase | 0:6105cf98b610 | 37 | |
| ikrase | 0:6105cf98b610 | 38 | |
| ikrase | 0:6105cf98b610 | 39 | |
| ikrase | 0:6105cf98b610 | 40 | |
| ikrase | 0:6105cf98b610 | 41 | }; |
| ikrase | 0:6105cf98b610 | 42 | |
| ikrase | 0:6105cf98b610 | 43 | |
| ikrase | 0:6105cf98b610 | 44 | |
| ikrase | 0:6105cf98b610 | 45 | #endif |