for BLE Nano v1 INPUT : Analog OUTPUT : USB Serial

Dependencies:   BLE_API mbed nRF51822

Committer:
electricbaka
Date:
Thu Jul 12 15:48:28 2018 +0000
Revision:
0:42bf46ed69f7
init

Who changed what in which revision?

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