-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBiWheel.h
59 lines (46 loc) · 1.27 KB
/
BiWheel.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
@ Filename: BiWheel.h
@ BiWheel is an Arduino library for chassis with two motors
@ driven by L293 or L298 H-bridge.
@ Created by Ilya S. Dubkov
@ e-mail: dubkov@skbrii.ru
@ April 24, 2014
@ Last update: Jan 17, 2016
@ by Ilya S. Dubkov
@ License information:
@ This library is free software; you can redistribute it and/or
@ modify it under the terms of the GNU Lesser General Public
@ License as published by the Free Software Foundation; either
@ version 2.1 of the License, or (at your option) any later version.
@ This library is distributed in the hope that it will be useful,
@ but WITHOUT ANY WARRANTY; without even the implied warranty of
@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@ Lesser General Public License for more details.
*/
#ifndef BiWheel_h
#define BiWheel_h
#define PWM_MIN 150
#define PWM_MAX 255
class biWheel
{
public:
biWheel(int, int, int, int);
inline int spdToPWMduty(int);
void leftMotorStop();
void rightMotorStop();
void leftMotorForwardPWM(int);
void leftMotorBackwardPWM(int);
void rightMotorForwardPWM(int);
void rightMotorBackwardPWM(int);
void leftMotor(int);
void rightMotor(int);
void drive(int, int);
private:
int _in1;
int _in2;
int _in3;
int _in4;
int _spdl;
int _spdr;
};
#endif