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: BLE_nRF8001 mbed
Servo.h@0:4c34e71b2f6a, 2014-10-22 (annotated)
- Committer:
- RedBearLab
- Date:
- Wed Oct 22 05:01:13 2014 +0000
- Revision:
- 0:4c34e71b2f6a
- Child:
- 1:d743c358f812
First commit
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| RedBearLab | 0:4c34e71b2f6a | 1 | #ifndef _SERVO_H |
| RedBearLab | 0:4c34e71b2f6a | 2 | #define _SERVO_H |
| RedBearLab | 0:4c34e71b2f6a | 3 | |
| RedBearLab | 0:4c34e71b2f6a | 4 | #include "mbed.h" |
| RedBearLab | 0:4c34e71b2f6a | 5 | |
| RedBearLab | 0:4c34e71b2f6a | 6 | class Servo |
| RedBearLab | 0:4c34e71b2f6a | 7 | { |
| RedBearLab | 0:4c34e71b2f6a | 8 | public: |
| RedBearLab | 0:4c34e71b2f6a | 9 | Servo(PinName pin); |
| RedBearLab | 0:4c34e71b2f6a | 10 | ~Servo(void); |
| RedBearLab | 0:4c34e71b2f6a | 11 | |
| RedBearLab | 0:4c34e71b2f6a | 12 | void write(unsigned char degree); |
| RedBearLab | 0:4c34e71b2f6a | 13 | |
| RedBearLab | 0:4c34e71b2f6a | 14 | private: |
| RedBearLab | 0:4c34e71b2f6a | 15 | void convert(unsigned char degree); |
| RedBearLab | 0:4c34e71b2f6a | 16 | |
| RedBearLab | 0:4c34e71b2f6a | 17 | PwmOut _servo; |
| RedBearLab | 0:4c34e71b2f6a | 18 | unsigned int pulse; |
| RedBearLab | 0:4c34e71b2f6a | 19 | }; |
| RedBearLab | 0:4c34e71b2f6a | 20 | |
| RedBearLab | 0:4c34e71b2f6a | 21 | #endif |