
publishing repo to mbed
Dependencies: BLE_API mbed nRF51822
Servo.h@0:a7eab842b9e5, 2015-02-20 (annotated)
- Committer:
- dgdosen
- Date:
- Fri Feb 20 21:20:22 2015 +0000
- Revision:
- 0:a7eab842b9e5
stock ble nano starter project
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dgdosen | 0:a7eab842b9e5 | 1 | /* |
dgdosen | 0:a7eab842b9e5 | 2 | |
dgdosen | 0:a7eab842b9e5 | 3 | Copyright (c) 2012-2014 RedBearLab |
dgdosen | 0:a7eab842b9e5 | 4 | |
dgdosen | 0:a7eab842b9e5 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
dgdosen | 0:a7eab842b9e5 | 6 | and associated documentation files (the "Software"), to deal in the Software without restriction, |
dgdosen | 0:a7eab842b9e5 | 7 | including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, |
dgdosen | 0:a7eab842b9e5 | 8 | and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, |
dgdosen | 0:a7eab842b9e5 | 9 | subject to the following conditions: |
dgdosen | 0:a7eab842b9e5 | 10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
dgdosen | 0:a7eab842b9e5 | 11 | |
dgdosen | 0:a7eab842b9e5 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, |
dgdosen | 0:a7eab842b9e5 | 13 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
dgdosen | 0:a7eab842b9e5 | 14 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE |
dgdosen | 0:a7eab842b9e5 | 15 | FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
dgdosen | 0:a7eab842b9e5 | 16 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
dgdosen | 0:a7eab842b9e5 | 17 | |
dgdosen | 0:a7eab842b9e5 | 18 | */ |
dgdosen | 0:a7eab842b9e5 | 19 | |
dgdosen | 0:a7eab842b9e5 | 20 | #ifndef _SERVO_H |
dgdosen | 0:a7eab842b9e5 | 21 | #define _SERVO_H |
dgdosen | 0:a7eab842b9e5 | 22 | |
dgdosen | 0:a7eab842b9e5 | 23 | #include "mbed.h" |
dgdosen | 0:a7eab842b9e5 | 24 | |
dgdosen | 0:a7eab842b9e5 | 25 | class Servo |
dgdosen | 0:a7eab842b9e5 | 26 | { |
dgdosen | 0:a7eab842b9e5 | 27 | public: |
dgdosen | 0:a7eab842b9e5 | 28 | Servo(PinName pin); |
dgdosen | 0:a7eab842b9e5 | 29 | ~Servo(void); |
dgdosen | 0:a7eab842b9e5 | 30 | |
dgdosen | 0:a7eab842b9e5 | 31 | void write(unsigned char degree); |
dgdosen | 0:a7eab842b9e5 | 32 | |
dgdosen | 0:a7eab842b9e5 | 33 | private: |
dgdosen | 0:a7eab842b9e5 | 34 | void convert(unsigned char degree); |
dgdosen | 0:a7eab842b9e5 | 35 | |
dgdosen | 0:a7eab842b9e5 | 36 | PwmOut _servo; |
dgdosen | 0:a7eab842b9e5 | 37 | unsigned int pulse; |
dgdosen | 0:a7eab842b9e5 | 38 | }; |
dgdosen | 0:a7eab842b9e5 | 39 | |
dgdosen | 0:a7eab842b9e5 | 40 | #endif |