-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestCode
72 lines (48 loc) · 1003 Bytes
/
TestCode
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
#include "Servo.h"
Servo OutputM1;
Servo OutputM2;
Servo OutputM3;
Servo OutputM4;
Servo OutputM5;
Servo OutputM6;
int speed01 = 1400;
int speed02 = 1600;
const int InputA0 = A0;
int PotA0;
int Speed;
void setup() {
Serial.begin(57600);
//Serial1.begin(57600);
OutputM1.attach(5);
OutputM2.attach(6);
OutputM3.attach(7);
OutputM1.writeMicroseconds(1500);
OutputM2.writeMicroseconds(1500);
OutputM3.writeMicroseconds(1500);
}
void loop() {
up();
delay(1);
}
void up(){
OutputM3.writeMicroseconds(speed01);
}
void down(){
OutputM3.writeMicroseconds(speed02);
}
void turnleft(){
OutputM1.writeMicroseconds(speed01);
OutputM2.writeMicroseconds(speed02);
}
void turnright(){
OutputM1.writeMicroseconds(speed02);
OutputM2.writeMicroseconds(speed01);
}
void forwards(){
OutputM1.writeMicroseconds(speed02);
OutputM2.writeMicroseconds(speed02);
}
void backwards(){
OutputM1.writeMicroseconds(speed01);
OutputM2.writeMicroseconds(speed01);
}