-
Notifications
You must be signed in to change notification settings - Fork 19
/
MotorTestBack.ino
executable file
·51 lines (41 loc) · 1.21 KB
/
MotorTestBack.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
#define leftMotor1 7
#define leftMotor2 6
#define rightMotor1 5
#define rightMotor2 8
#define led 13
void setup()
{
pinMode(leftMotor1, OUTPUT);
pinMode(leftMotor2, OUTPUT);
pinMode(rightMotor1, OUTPUT);
pinMode(rightMotor2, OUTPUT);
pinMode(led, OUTPUT);
}
void loop()
{
digitalWrite(leftMotor1, LOW);
digitalWrite(leftMotor2, HIGH);
digitalWrite(rightMotor1, HIGH);
digitalWrite(rightMotor2, LOW);
digitalWrite(13, LOW); // set the LED off
delay(2);
digitalWrite(leftMotor1, LOW);
digitalWrite(leftMotor2, LOW);
digitalWrite(rightMotor1, LOW);
digitalWrite(rightMotor2, LOW);
digitalWrite(13, HIGH); // set the LED on
delay(1);
/*digitalWrite(leftMotor2, HIGH);
digitalWrite(leftMotor1, LOW);
digitalWrite(rightMotor2, HIGH);
digitalWrite(rightMotor1, LOW);
digitalWrite(13, HIGH); // set the LED on
delay(3000); // wait for a second
digitalWrite(leftMotor2, LOW);
digitalWrite(leftMotor1, HIGH);
digitalWrite(rightMotor2, LOW);
digitalWrite(rightMotor1, HIGH);
digitalWrite(13, LOW); // set the LED off
delay(3000); // wait for a second
*/
}