Lightweight FlyBed1, structure based on KK-Board Firmware First this one should work, then I can get more complex FlyBed1 working :)

Dependencies:   mbed MODI2C

Servo_PWM/Servo_PWM.h

Committer:
maetugr
Date:
2013-04-29
Revision:
0:d51bf879e9df

File content as of revision 0:d51bf879e9df:

// 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