-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bronze.ino
72 lines (53 loc) · 1.3 KB
/
Bronze.ino
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 <AFMotor.h>
#include <Servo.h>
//turn on motors
AF_DCMotor motor1(1);
AF_DCMotor motor2(2);
AF_DCMotor motor3(3);
AF_DCMotor motor4(4);
Servo servo1;
AF_Stepper stepper(48, 2);
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Motor party!");
// turn on servo
servo1.attach(9);
motor1.setSpeed(200);
motor2.setSpeed(200);
//motor2.run(RELEASE);
motor3.setSpeed(200);
//motor3.run(RELEASE);
motor4.setSpeed(200);
//motor4.run(RELEASE);
}
int i;
// Test the DC motor, stepper and servo ALL AT ONCE!
void loop() {
motor2.run(BACKWARD); motor3.run(BACKWARD);
delay(200);
motor2.run(RELEASE); motor3.run(RELEASE);
//pick code
motor4.run(FORWARD);
delay(2500);
motor4.run(RELEASE);
motor2.run(FORWARD); motor3.run(FORWARD);
delay(2000);
motor2.run(RELEASE); motor3.run(RELEASE);
motor1.run(FORWARD);
delay(400);
motor1.run(RELEASE);
motor2.run(BACKWARD); motor3.run(BACKWARD);
delay(1000);
motor2.run(RELEASE); motor3.run(RELEASE);
//drop code
motor4.run(BACKWARD);
delay(2500);
motor4.run(RELEASE);
motor2.run(FORWARD); motor3.run(FORWARD);
delay(1000);
motor2.run(RELEASE); motor3.run(RELEASE);
motor1.run(BACKWARD);
delay(400);
motor1.run(RELEASE);
exit(0);
}