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