-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaceholders.cpp
More file actions
78 lines (52 loc) · 1.61 KB
/
placeholders.cpp
File metadata and controls
78 lines (52 loc) · 1.61 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
The impementation file for the placeholders.h header file.
*/
// inclusions
#pragma once
#include "paceholders.h"
/*
setDrive(int) commands the wheels to move forward at a inputed streangth from -128 to 127.
A steangth of 127 is full forward drive, 0 is no drive or stop, and -128 is full reverse drive.
Values above 127 or below -128 are automatically adjusted to fit within those bounds.
*/
void setDrive(signed char power)
{
if(power > 127)
{
// set torque of the wheels to 127
return;
}
else if(power < -128)
{
// set torque of the wheels to -128
return;
}
//set the torque of the wheels to "power"
}
/*
setDrive(int, int) sets the moter with the specified ID to the given power
0 is the left-front moter
1 is the right-front moter
2 is the back moter
*/
void setDrive(int moterID, signed char power)
{
// set torgue of moterID moter to power.
}
/*
setDrive(int, int, int) commands each wheels to move at a unique inputed streangth from -128 to 127.
A steangth of 127 is full forward drive, 0 is no drive or stop, and -128 is full reverse drive.
Values above 127 or below -128 are automatically adjusted to fit within those bounds.
mPowLeft is the front left moter. (ID: 0)
mPowRight is the front right moter. (ID: 1)
mPowBack is the back center moter. (ID: 2)
*/
void setDrive(signed char mPowLeft, signed char mPowRight, signed char mPowBack)
{
// set torque of front-left moter
setDrive(0, mPowLeft);
// set torque of front-right moter
setDrive(1, mPowRight);
// set torque of back-center moter
setDrive(2, mPowBack);
}