User Manual
connections with shorting blocks should you want to revert back to the default pin mappings
later.)
• Next, connect Arduino pin 2 to M1INB, pin 7 to M2INB, and pin 9 to M2PWM. The orange,
brown, and purple “wires” in the picture to the right are one example of where these
connections can be made. You might find it convenient to first solder 2×1 pieces of the
included 0.1″ male header strip into these holes and then use jumper wires
[https://www.pololu.com/product/1706] or, in the case of neighboring pins, shorting blocks
[https://www.pololu.com/product/968] to make these connections.
To use our Arduino library [http://github.com/pololu/dual-vnh5019-motor-shield] with your newly
reconfigured board, you should initialize your DualVNH5019MotorShield object as follows:
When the library object is initialized this way, you can treat your single motor as if it were motor 1
(i.e. all of the “M1” library functions will work on the single motor channel). However, note that the
getM1CurrentMilliamps() method will not return a meaningful result since current sense feedback is
not available in single-channel mode. Also, you will need to check both M1 and M2 faults in order
to get an accurate picture of the driver’s fault status: getM1Fault() effectively only returns the fault
status of half-bridge A and getM2Fault() effectively returns the fault status of half-bridge B. You could
conceivably connect the two fault lines together into a single fault line, but you would want to do so
before the 1k protection resistors (such as by connecting them together via the “MxEN/DIAG A=B”
pins, which give you access to the lines before the protection resistors).
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
#include "DualVNH5019MotorShield.h"
// configure library with pins as remapped for single-channel operation
// this lets the single motor be controlled as if it were "motor 1"
DualVNH5019MotorShield md(2, 7, 6, A0, 2, 7, 12, A1);
void setup()
{
md.init();
// remaining setup code goes here
...
}
void loop()
{
// loops endlessly; main loop goes here
// the following code is a simple example:
md.setM1Speed(400); // single-channel motor full-speed "forward"
delay(2000); // wait for 2 seconds
md.setM1Speed(0); // single-channel motor stop (coast)
delay(500); // wait for 0.5 s
md.setM1Speed(-400); // single-channel motor full-speed "reverse"
delay(2000); // wait for 2 seconds
md.setM1Speed(0); // single-channel motor stop (coast)
delay(500); // wait for 0.5 s
}
?
Pololu Dual VNH5019 Motor Driver Shield User’s Guide © 2001–2017 Pololu Corporation
7. Using the Driver in Single-Channel Mode Page 32 of 35