nRF51822 BLE control program using RCBController(iOS9). Control one LED(on/off), one LED(duty/PWM) and Servo Motor. Compile with latest (as of today) Lib's.

Fork of BLE_RCBController2_Motor by robo 8080

Original software by jksoft-san. -> /users/jksoft/code/BLE_RCBController2/

Additional functions by robo8080-san. -> /users/robo8080/code/BLE_RCBController2_Motor/

Small modification under latest lib's at this moment (Jan. 1st, 2016)

Hardware: RedBearLab nRF51822 -> /platforms/RedBearLab-nRF51822/

Committer:
kenjiArai
Date:
Fri Jan 01 00:38:30 2016 +0000
Revision:
6:1aff9f05d487
nRF51822 BLE control program using RCBController(iOS9). Control one LED(on/off), one LED(duty/PWM) and Servo Motor. Compile with latest (as of today) Lib's.

Who changed what in which revision?

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