NOT FINISHED YET!!! My first try to get a self built fully working Quadrocopter based on an mbed, a self built frame and some other more or less cheap parts.

Dependencies:   mbed MODI2C

Servo_PWM/Servo_PWM.h

Committer:
maetugr
Date:
2014-02-14
Revision:
40:2ca410923691
Parent:
29:8b7362a2ee14

File content as of revision 40:2ca410923691:

// by MaEtUgR

#ifndef SERVO_PWM_H
#define SERVO_PWM_H

#include "mbed.h"

/** Class to control a servo by using PWM
 */

class Servo_PWM {

public:
    /** Create a new Servo object on any PWM pin
     *
     * @param Pin Pin on mbed to connect servo to
     */
    Servo_PWM(PinName Pin, int frequency);
    
    void SetFrequency(int frequency);
    
    /** Change the position of the servo. Position in us
     *
     * @param position The new value of the servos position between 0 and 1000 (gets 1000-2000) (us)
     */
    void SetPosition(int position);
    
    /** Operator for confortable positioning
     *
     * @param position see SetPosition
     */
    void operator=(int position);
    
    /** initialize ESC
     */
    void initialize();

private:
    PwmOut ServoPin;
    
};

#endif