How to interact Matlab with Arduino and Motor Shield Rev 3?

2 次查看(过去 30 天)
Hello,
I've been trying sync up Matlab and Arduino (along with a rev 3 motor shield) in order to controlk a DC motor.
After creating an arduino object, along with the add on object.
As specified below, the problem comes when creating a dcmotor object.
Is there a way to get past this? and
Are there libraries available specifically for this shield?
Thanks for reading.
a=arduino('COM6','Uno','Libraries'{'Adafruit/MotorShieldV2','I2C','RotaryEncoder'});
mot=addon(a,'Adafruit/MotorShieldV2');
% Here is where I have trouble
dcm= dcmotor(mot,'port'); % I cannot specify a port
% What I mean is that the Rev3 motor shield does not specifiy "M1" or "M2" insead it uses "Channel A and B" so this is a problem

回答(0 个)

社区

更多回答在  Power Electronics Control

类别

Help CenterFile Exchange 中查找有关 Arduino Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by