-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGold.ino
More file actions
39 lines (30 loc) · 653 Bytes
/
Gold.ino
File metadata and controls
39 lines (30 loc) · 653 Bytes
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
#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);
}
int i;
// Test the DC motor, stepper and servo ALL AT ONCE!
void loop() {
motor4.run(FORWARD);
delay(2500);
motor4.run(RELEASE);
motor1.run(FORWARD);
delay(2000);
motor1.run(RELEASE);
motor1.run(BACKWARD);
delay(2000);
motor1.run(RELEASE);
exit(0);
}