Problem loading Adafriut MotorShieldV2 library

4 views (last 30 days)
Hi, There seem to be a lot on unanswered questions similar to mine, but here goes: I have an Adafruit MotorShield V2.3 on an Arduino Uno and want to control a stepper motor with it, but can't get the MotorShieldV2 library to load, although I can load other libraries with no problem. I'm using MatLab 2016a and have tried it under 64-bit Windows 10 on a laptop and 64-bit Windows 7 on a desktop. Here's what I've tried:
a=arduino
a =
arduino with properties:
Port: 'COM3'
Board: 'Uno'
AvailablePins: {'D2-D13', 'A0-A5'}
Libraries: {'I2C'}
and all seems OK.
If I do this:
listArduinoLibraries()
I get:
ans =
'Adafruit/MotorShieldV2'
'I2C'
'SPI'
'Servo' "
I
clear a
and can then load any of three libraries successfully (with or without 'ForceBuild') :
a = arduino('COM3','Uno','Libraries',{'I2C' 'Servo' 'SPI'},'ForceBuild',true)
Updating server code on board Uno (COM3). Please wait.
a =
arduino with properties:
Port: 'COM3'
Board: 'Uno'
AvailablePins: {'D2-D13', 'A0-A5'}
Libraries: {'I2C', 'SPI', 'Servo'}
I
clear a
again but can't get the MotorShieldV2 library to load (with or without 'ForceBuild'):
a = arduino('COM3','Uno','Libraries','Adafruit/MotorShieldV2','ForceBuild',true)
Updating server code on board Uno (COM3). Please wait.
Cannot program board Uno (COM3). Please make sure the board is supported and the port and board type
are correct.
Any ideas on what I might be doing wrong, or not doing?
Thanks.

Answers (2)

Venkata Siva Krishna Madala
Hello Tony,
You are loading the Library incorrectly. It should be
a = arduino('COM3', 'Uno', 'Libraries', 'Adafruit\MotorShieldV2')
For more information please refer to Control Motors Using Adafruit® Motor Shield V2.
Regards,
Krishna Madala
  1 Comment
Tony Pryse
Tony Pryse on 1 Mar 2018
Hi Krishna,
I have tried it with both a front-slash ('Adafruit/MotorShieldV2') and a back-slash ('Adafruit\MotorShieldV2') and get the same error both ways. (Or is there another difference that you are pointing out in your answer??)
Tony

Sign in to comment.


Svenja Be
Svenja Be on 5 Dec 2019
Hey Tony!
I know this is an old question but maybe you'll still read this. I got the same problem with the Adafruit/NeoPixel library. Did you find a solution?
Thank you,
Svenja

Categories

Find more on Arduino Hardware in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!