Luis Bernal / Mbed 2 deprecated xbeat-hoppel-code

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers motor.h Source File

motor.h

00001 /*
00002  *
00003  * This program is free software; you can redistribute it and/or modify
00004  * it under the terms of the GNU General Public License as published by
00005  * the Free Software Foundation; either version 3 of the License, or
00006  * (at your option) any later version.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  * GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00015  *
00016  * @file motor.h
00017  * @author Andre Moehl
00018  * @date 01/2011
00019  * @brief Servo Motor Class definition
00020  */
00021  
00022 
00023 
00024 #ifndef __MOTOR_H
00025 #define __MOTOR_H
00026 
00027 /*--- Includes ------------------------*/
00028 #include "mbed.h"
00029 
00030 /*--- Class Declaration----------------*/
00031 
00032 /**
00033     Class Motor
00034 */
00035 class Motor
00036 {
00037     
00038     public:
00039         /** @brief Constructor
00040         *   @parameter Pin Servo Motor Pin
00041         *   @parameter periode Periode for Servo Signal
00042         */
00043         Motor(PinName Pin, int periode);   
00044         ~Motor();
00045         /** @brief Sets the pulse width ergo the servo rotation speed 
00046         *   @parameter value pulsewidth in microseconds as integer
00047         */
00048         void speed(int value);     
00049                 
00050     private:
00051         PwmOut _PwmPin;
00052 
00053 };
00054 
00055 #endif