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