Skip to content

Commit f72b94b

Browse files
committed
update for full forward and full backward test of all motors
1 parent b8b502f commit f72b94b

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

DualVNH5019MotorShieldMod3/examples/Test_Motors/Test_Motors.ino

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,45 @@ md.setM2Speed(0); // single-channel motor stop (coast)
6363

6464
delay(500); // wait for 0.5 s
6565

66+
md.setM3Speed(400); // single-channel motor full-speed "forward"
67+
68+
delay(2000); // wait for 2 seconds
69+
70+
md.setM3Speed(0); // single-channel motor stop (coast)
71+
72+
delay(500); // wait for 0.5 s
73+
74+
md.setM4Speed(400); // single-channel motor full-speed "forward"
75+
76+
delay(2000); // wait for 2 seconds
77+
78+
md.setM4Speed(0); // single-channel motor stop (coast)
79+
80+
delay(500); // wait for 0.5 s
81+
82+
md.setM1Speed(0); // single-channel motor stop (coast)
83+
md.setM2Speed(0); // single-channel motor stop (coast)
84+
md.setM3Speed(0); // single-channel motor stop (coast)
85+
md.setM4Speed(0); // single-channel motor stop (coast)
86+
87+
// the following code is a simple example:
88+
//
89+
md.setM1Speed(-400); // single-channel motor full-speed "forward"
90+
91+
delay(2000); // wait for 2 seconds
92+
93+
md.setM1Speed(0); // single-channel motor stop (coast)
94+
95+
delay(500); // wait for 0.5 s
96+
97+
md.setM2Speed(-400); // single-channel motor full-speed "reverse"
98+
99+
delay(2000); // wait for 2 seconds
100+
101+
md.setM2Speed(0); // single-channel motor stop (coast)
102+
103+
delay(500); // wait for 0.5 s
104+
66105
md.setM3Speed(-400); // single-channel motor full-speed "forward"
67106

68107
delay(2000); // wait for 2 seconds
@@ -83,4 +122,5 @@ md.setM1Speed(0); // single-channel motor stop (coast)
83122
md.setM2Speed(0); // single-channel motor stop (coast)
84123
md.setM3Speed(0); // single-channel motor stop (coast)
85124
md.setM4Speed(0); // single-channel motor stop (coast)
125+
86126
}

0 commit comments

Comments
 (0)