Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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__ */