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.
ArduMotoShield.h
00001 /* 00002 Simple library for the SparkFun Ardumoto Shield https://www.sparkfun.com/products/9815 00003 with the ST Nucleo F401RE 00004 00005 The SparkFun Ardumoto shield can control two DC motors (up to 2 amps per motor). It is based on the L298 H-bridge. 00006 00007 Developped by : Didier Donsez & Jérome Maisonnasse 00008 00009 License: CC-SA 3.0, feel free to use this code however you'd like. 00010 Please improve upon it! Let me know how you've made it better. 00011 00012 This is really simple example code to get you some basic functionality with the Ardumoto Shield. 00013 00014 */ 00015 00016 00017 #ifndef MBED_ARDUMOTOSHIELD_H 00018 #define MBED_ARDUMOTOSHIELD_H 00019 00020 #include "mbed.h" 00021 00022 class ArduMotoShield { 00023 public: 00024 static void setVoltages(float vin, float vmaxmotor); 00025 00026 static void stop(); 00027 static void forward(); 00028 static void backward(); 00029 static void left(); 00030 static void right(); 00031 private: 00032 static void setup(); 00033 }; 00034 00035 #endif
Generated on Thu Jul 14 2022 00:15:48 by 1.7.2