Sketch for running a motor off the Pololu G2 High-Power Motor Driver breakout board using the G2MotorDriver Library
This sketch requires the photodude/G2MotorDriver library.
This Library is designed to work with the Arduino IDE versions 1.8.x or later; we have not tested it with earlier versions. This sketch and parent Library support any Arduino compatible board and the Pololu G2 High-Power Motor Driver breakout board
The Pololu G2 High-Power Motor Driver breakout board can be purchased from Pololu's website. Before continuing, careful reading of the product page is recommended.
If you are using version 1.6.2 or later of the Arduino software (IDE), you can use the Library Manager to install this library:
- In the Arduino IDE, open the "Sketch" menu, select "Include Library", then "Manage Libraries...".
- Search for "G2MotorDriver".
- Click the G2MotorDriver entry in the list.
- Click "Install".
If this does not work, you can manually install the library:
- Download the latest release archive from GitHub and decompress it.
- Rename the folder "G2MotorDriver-xxxx" to "G2MotorDriver".
- Drag the "G2MotorDriver" folder into the "libraries" directory inside your Arduino sketchbook directory. You can view your sketchbook location by opening the "File" menu and selecting "Preferences" in the Arduino IDE. If there is not already a "libraries" folder in that location, you should make the folder yourself.
- After installing the library, restart the Arduino IDE.
You will also need this sketch
- Download the latest release archive from GitHub and decompress it.
- Rename the folder "Automotive_fan_serial-xxxx" to "Automotive_fan_serial".
Speed input on serial should be between -400 and 400. 0 corresponds to full coast.
Other funtions and details are documented in the parent photodude/G2MotorDriver library.
- 0.0.1 (2019-04-06): Inital version used in testing.