Files
ManGoWalk_STM32/fun/Motor.h
2025-06-28 22:33:16 +08:00

28 lines
433 B
C

#ifndef __MOTOR_H__
#define __MOTOR_H__
#include "headfile.h"
void PWM_GPIO_TIM_Init(void);
void MotorA_Dir(uint8_t dir);
void MotorB_Dir(uint8_t dir);
// 控制 电机A的速度
void MotorA_Speed(uint8_t speed);
// 控制 电机B的速度
void MotorB_Speed(uint8_t speed);
// 示例 同时控制电机A/B
// 提示 对于 Dir 0 ---- 前进 go forward
// 对于 Dir 1 ---- 后退 go forward
void DriveBOTH(int16_t speedA,int16_t speedB);
#endif