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@3:1d16a22386a8, 2015-06-27 (annotated)
- Committer:
- ikrase
- Date:
- Sat Jun 27 06:37:14 2015 +0000
- Revision:
- 3:1d16a22386a8
- Parent:
- 2:f982504e6e84
- Child:
- 6:bad5554bb890
Started work on specified timeout.
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 | 1:1135f0b1566e | 5 | #include "FPointer.h" |
ikrase | 0:6105cf98b610 | 6 | #include <vector> |
ikrase | 3:1d16a22386a8 | 7 | #include "SpecifiedTimeout.h" |
ikrase | 0:6105cf98b610 | 8 | |
ikrase | 0:6105cf98b610 | 9 | |
ikrase | 0:6105cf98b610 | 10 | #define SERVO_DISABLED -1 // This is going to take raw servo microsecond entries. |
ikrase | 2:f982504e6e84 | 11 | #define PPM_PERIOD 20000 // In microseconds |
ikrase | 0:6105cf98b610 | 12 | |
ikrase | 0:6105cf98b610 | 13 | class Polyservo { |
ikrase | 0:6105cf98b610 | 14 | public: |
ikrase | 0:6105cf98b610 | 15 | |
ikrase | 0:6105cf98b610 | 16 | std::vector<DigitalOut *> servos; |
ikrase | 0:6105cf98b610 | 17 | //DigitalOut * servos; |
ikrase | 0:6105cf98b610 | 18 | |
ikrase | 0:6105cf98b610 | 19 | bool global_enable; |
ikrase | 1:1135f0b1566e | 20 | std::vector<int> positions; |
ikrase | 0:6105cf98b610 | 21 | int numservos; |
ikrase | 0:6105cf98b610 | 22 | |
ikrase | 0:6105cf98b610 | 23 | Polyservo(DigitalOut servo_pins[], int num_pins); |
ikrase | 1:1135f0b1566e | 24 | void set_position(int s, int pos); |
ikrase | 0:6105cf98b610 | 25 | |
ikrase | 0:6105cf98b610 | 26 | |
ikrase | 0:6105cf98b610 | 27 | |
ikrase | 0:6105cf98b610 | 28 | |
ikrase | 0:6105cf98b610 | 29 | |
ikrase | 0:6105cf98b610 | 30 | private: |
ikrase | 0:6105cf98b610 | 31 | |
ikrase | 0:6105cf98b610 | 32 | Ticker period_tick; |
ikrase | 1:1135f0b1566e | 33 | std::vector<Timeout *> servo_timers; |
ikrase | 0:6105cf98b610 | 34 | //Timeout * servo_times; |
ikrase | 0:6105cf98b610 | 35 | |
ikrase | 1:1135f0b1566e | 36 | uint32_t servo_set(uint32_t); |
ikrase | 1:1135f0b1566e | 37 | |
ikrase | 1:1135f0b1566e | 38 | void servos_reset(void); |
ikrase | 1:1135f0b1566e | 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 | |
ikrase | 0:6105cf98b610 | 46 | |
ikrase | 0:6105cf98b610 | 47 | }; |
ikrase | 0:6105cf98b610 | 48 | |
ikrase | 0:6105cf98b610 | 49 | |
ikrase | 0:6105cf98b610 | 50 | |
ikrase | 0:6105cf98b610 | 51 | #endif |