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