I have an old motor shield but can see the revision 3 is still being sold: https://store.arduino.cc/arduino-motor-shield-rev3
When I follow the link for "Getting Started section" the page lists a lot of shields but not the motor shield. I must be missing something really obviously but I can't find a library for the motor board.
I'm trying to drive 2 DC motors.
-
1Have you googled this, before asking here? I googled "Arduino motor shield rev3 library" and directly found this library on github. Have you tried it or any other library?chrisl– chrisl2019年06月03日 20:30:58 +00:00Commented Jun 3, 2019 at 20:30
-
Yes for the last 90 minutes: ecosia.org/… ecosia.org/search?q=arduino+motor+shield+library+-adafruit google.com/… google.com/search?q=arduino+motor+shield+library+example Granted that for me: google.com/search?q=arduino+motor+shield+library shows your link as the fifth result down for but then it's followed by Adafruit Motor Shield again... their SEO is too good.AJP– AJP2019年06月03日 21:06:21 +00:00Commented Jun 3, 2019 at 21:06
-
Ok so using Ecosia is part of the "problem", along with Adafruit's SEO... but I just realised Ecosia is powered by bing.com and the extreme irony is that this question is already indexed as result number 7 but the library you helpfully provided is not! bing.com/search?q=arduino+motor+shield+library LOLAJP– AJP2019年06月03日 21:12:11 +00:00Commented Jun 3, 2019 at 21:12
-
Often it is helpful to add the term github to your search, since almost every Arduino library is hosted there.chrisl– chrisl2019年06月03日 21:13:49 +00:00Commented Jun 3, 2019 at 21:13
-
Thanks @chrisl something seriously weird is going on with all my filter bubbles because your result now isn't shown in my google search after being shown in it minutes before... * so confused *. Adding github just shows the Adafruit barrage, at least on page 1.AJP– AJP2019年06月03日 21:19:27 +00:00Commented Jun 3, 2019 at 21:19
1 Answer 1
From Chrisl's comment: https://github.com/gallingern/arduino-motor-shield-r3
You don't really need a library though as the code is simple enough:
void setup() {
//Setup Channel A
pinMode(12, OUTPUT); //Initiates Motor Channel A pin
pinMode(9, OUTPUT); //Initiates Brake Channel A pin
}
void loop(){
//forward @ full speed
digitalWrite(12, HIGH); //Establishes forward direction of Channel A
digitalWrite(9, LOW); //Disengage the Brake for Channel A
analogWrite(3, 255); //Spins the motor on Channel A at full speed
delay(3000);
digitalWrite(9, HIGH); //Engage the Brake for Channel A
}