My fully self designed first stable working Quadrocopter Software.

Dependencies:   mbed

Dependents:   fluy343

/media/uploads/maetugr/dsc09031.jpg

Servo_PWM/Servo_PWM.h

Committer:
maetugr
Date:
2013-09-08
Revision:
1:5e2b81f2d0b4
Parent:
0:12950aa67f2a
Child:
5:06e978fd147a

File content as of revision 1:5e2b81f2d0b4:

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

private:
    PwmOut ServoPin;
    
};

#endif