Yosuke Kirihata / Mbed 2 deprecated Nucleo_extended_servo

Dependencies:   mbed

PwmServo.h

Committer:
YosukeK
Date:
2014-10-15
Revision:
5:8223f5a154e2
Parent:
0:916047fa0d8b

File content as of revision 5:8223f5a154e2:

#ifndef __PWMSERVO_H__
#define __PWMSERVO_H__

#include <mbed.h>

/**
 * サーボ制御基底クラス
 * Kyoto-Densou-An 2014
 * @author yishii
 */

class PwmServo
{
    public:
        /**
         * コンストラクタ
         */
        PwmServo(PinName pin);
        
        /**
         * デストラクタ
         */
        ~PwmServo();
        
        /**
         * 角度設定
         * @param angle 角度
         */
        void setAngle(float angle);
    
    private:
        static const int PWM_CONTROL_PERIOD = 20; /** @brief PWM周期 */
        PwmOut* pwm; /** @brief PwmOutインスタンス */
};

#endif /* __PWMSERVO_H__ */