//
// TailControl.h
//

#ifndef TAILDCONTROL_H_
#define TAILDCONTROL_H_


#include "Motor.h"
using namespace ecrobot;

// 姰慡掆巭帪偺妏搙[搙]
#define TAIL_ANGLE_STAND_UP 120

// 僶儔儞僗憱峴帪偺妏搙[搙]
#define TAIL_ANGLE_DRIVE      3

// 僗僞乕僩帪偺妏搙[搙]
#define TAIL_ANGLE_START 130


// 姰慡掆巭梡儌乕僞惂屼斾椺學悢
#define P_GAIN             2.5F

// 姰慡掆巭梡儌乕僞惂屼PWM愨懳嵟戝抣
#define PWM_ABS_MAX          60

extern "C"
{
	#include "balancer.h"
};


class TailControl
{
public:

	//
	// Constructor
	//
	TailControl(Motor* pMotorT);
	
	~TailControl();
	
	//
	// 怟旜傪惂屼偡傞
	//
	void tail_control(signed int angle);
	
	void stand(float pwm);
	
	bool isAngle(signed int angle);

private:

	Motor* m_pMotorT;
};

#endif
