How to Control an Arduino from MATLAB


I found a quick tutorial on how to Interface an Arduino with MATLAB.

The tutorial shows how to blink an LED from MATLAB.

Here's what the code looks like:

% create an Arduino object
a = arduino('com3', 'uno');     
% start the loop to blink led for 10 seconds
for i = 1:10
    writeDigitalPin(a, 'D11', 1);
    pause(0.5);
    writeDigitalPin(a, 'D11', 0);
    pause(0.5);
end
% end communication with Arduino
clear a
Madhu Govindarajan
Madhu Govindarajan on 30 Mar 2018

Links to more advanced stuff would be great :)

Laith Al-Taie
Laith Al-Taie on 12 Apr 2018

Like a closed loop control of a stepper motor :)

Paul Kassebaum
Paul Kassebaum on 30 Mar 2018

Have heart, getting an LED to blink is not that far from more interesting things, such as this cute blinking heart.

Tags