Simple library and program for the SparkFun Ardumoto Shield https://www.sparkfun.com/products/9815 with the ST Nucleo F401RE The SparkFun Ardumoto shield can control two DC motors (up to 2 amps per motor). It is based on the L298 H-bridge. Developped by : Didier Donsez & Jérome Maisonnasse License: CC-SA 3.0, feel free to use this code however you'd like. Please improve upon it! Let me know how you've made it better. This is really simple example code to get you some basic functionality with the Ardumoto Shield.

Committer:
donsez
Date:
Sat Nov 08 15:44:22 2014 +0000
Revision:
0:72e45c332025
Create simple library and program for the SparkFun Ardumoto Shield https://www.sparkfun.com/products/9815;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
donsez 0:72e45c332025 1 /*
donsez 0:72e45c332025 2 Simple library for the SparkFun Ardumoto Shield https://www.sparkfun.com/products/9815
donsez 0:72e45c332025 3 with the ST Nucleo F401RE
donsez 0:72e45c332025 4
donsez 0:72e45c332025 5 The SparkFun Ardumoto shield can control two DC motors (up to 2 amps per motor). It is based on the L298 H-bridge.
donsez 0:72e45c332025 6
donsez 0:72e45c332025 7 Developped by : Didier Donsez & Jérome Maisonnasse
donsez 0:72e45c332025 8
donsez 0:72e45c332025 9 License: CC-SA 3.0, feel free to use this code however you'd like.
donsez 0:72e45c332025 10 Please improve upon it! Let me know how you've made it better.
donsez 0:72e45c332025 11
donsez 0:72e45c332025 12 This is really simple example code to get you some basic functionality with the Ardumoto Shield.
donsez 0:72e45c332025 13
donsez 0:72e45c332025 14 */
donsez 0:72e45c332025 15
donsez 0:72e45c332025 16
donsez 0:72e45c332025 17 #ifndef MBED_ARDUMOTOSHIELD_H
donsez 0:72e45c332025 18 #define MBED_ARDUMOTOSHIELD_H
donsez 0:72e45c332025 19
donsez 0:72e45c332025 20 #include "mbed.h"
donsez 0:72e45c332025 21
donsez 0:72e45c332025 22 class ArduMotoShield {
donsez 0:72e45c332025 23 public:
donsez 0:72e45c332025 24 static void setVoltages(float vin, float vmaxmotor);
donsez 0:72e45c332025 25
donsez 0:72e45c332025 26 static void stop();
donsez 0:72e45c332025 27 static void forward();
donsez 0:72e45c332025 28 static void backward();
donsez 0:72e45c332025 29 static void left();
donsez 0:72e45c332025 30 static void right();
donsez 0:72e45c332025 31 private:
donsez 0:72e45c332025 32 static void setup();
donsez 0:72e45c332025 33 };
donsez 0:72e45c332025 34
donsez 0:72e45c332025 35 #endif