ADT7410 sample

Dependencies:   ADT7410 BLE_API mbed nRF51822

Fork of BLENano_SimpleTemplate_temp_170802 by Jun ADI

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Servo.h Source File

Servo.h

00001 /*
00002 
00003 Copyright (c) 2012-2014 RedBearLab
00004 
00005 Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
00006 and associated documentation files (the "Software"), to deal in the Software without restriction, 
00007 including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
00008 and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, 
00009 subject to the following conditions:
00010 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
00011 
00012 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
00013 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
00014 PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
00015 FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
00016 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00017 
00018 */
00019 
00020 #ifndef _SERVO_H
00021 #define _SERVO_H
00022 
00023 #include "mbed.h"
00024 
00025 class Servo
00026 {
00027 public:
00028     Servo(PinName pin);
00029     ~Servo(void);
00030     
00031     void write(unsigned char degree);
00032 
00033 private:
00034     void convert(unsigned char degree);
00035     
00036     PwmOut _servo;
00037     unsigned int pulse;
00038 };
00039 
00040 #endif