Stm32Project/Inc/servo.h

9 lines
238 B
C
Raw Normal View History

2024-11-06 22:26:06 +08:00
#include "main.h"
//Tanslate angle into Capture Compare Register value
#define ANGLETOCCR(angle) (2000 * (angle) / 180 + 500)
2024-11-06 22:26:06 +08:00
extern int16_t Servo_Speed,Servo_goal,Servo_position;
2024-11-06 22:26:06 +08:00
void Servo_SetAngle(int goal);
int Servo_toward(void);