Problem loading Adafriut MotorShieldV2 library

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.

답변 (2개)

Venkata Siva Krishna Madala
Venkata Siva Krishna Madala 2018년 3월 1일

0 개 추천

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

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

댓글을 달려면 로그인하십시오.

Svenja Be
Svenja Be 2019년 12월 5일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 Arduino Hardware에 대해 자세히 알아보기

질문:

2018년 2월 26일

답변:

2019년 12월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by