Adafruit Motor Shield MATLAB GUI

2 views (last 30 days)
Colm
Colm on 7 Aug 2014
Hi all,
This is my first post.
I am currently building an xy gantry as a part of a project. I am using an Arduino Uno, an Adafruit Motor Shield, and 2 stepper motors. I have interfaced the Arduino with a MATLAB GUI and the connection is working great but what I am finding is that as I run the program I created I cannot run the 2 motors simultaneously. One axis moves the required steps and then once its finished the second moves. Its simple code but surely it should work?
function BeginButton_Callback(hObject, eventdata, handles)
% hObject handle to BeginButton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global a;
a.stepperSpeed(1, 1);
a.stepperSpeed(2, 1);
a.stepperStep(1, 'backward', 'double',255);
a.stepperStep(2, 'forward', 'double', 255);
I've seen a cnc build on the arduino website where they speak of using a motor shield and sparkfun easy driver to drive the 3 motors but cannot get it to work myself.
Can anyone help me out on this one?
Thanks,
Colm

Answers (0)

Communities

More Answers in the  Power Electronics Control

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!