forked from monkeylover1234/mesacmsrobotics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDeviceDriverSet_xxx0.h
41 lines (33 loc) · 1.05 KB
/
DeviceDriverSet_xxx0.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef _DeviceDriverSet_xxx0_H_
#define _DeviceDriverSet_xxx0_H_
#include <arduino.h>
/*Motor*/
class DeviceDriverSet_Motor
{
public:
void DeviceDriverSet_Motor_Init(void);
#if _Test_DeviceDriverSet
void DeviceDriverSet_Motor_Test(void);
#endif
void DeviceDriverSet_Motor_control(boolean direction_A, uint8_t speed_A, //A组电机参数
boolean direction_B, uint8_t speed_B, //B组电机参数
boolean controlED //AB使能允许 true
); //电机控制
int turn(int targetAngle);
private:
#define PIN_Motor_PWMA 5
#define PIN_Motor_PWMB 6
#define PIN_Motor_BIN_1 8
#define PIN_Motor_AIN_1 7
#define PIN_Motor_STBY 3
public:
#define speed_Max 255
#define direction_just true
#define direction_back false
#define direction_void 3
#define Duration_enable true
#define Duration_disable false
#define control_enable true
#define control_disable false
};
#endif