Welcome to the seventh Arduino Tutorial from our Arduino Tutorial Series. In this tutorial we will learn how to connect Arduino to Matlab and how are they communicatng using the Serial Port. Also we will make an example where we will use Matlab to control the Arduino Board.
This is a Step by Step Video Tutorial which is easy to be followed. Also, below the video you can find the parts needed for this tutorial and the Source Codes of the Examples in the video.
Circuit schematic of the examples
clear a; a = arduino('COM4'); a.pinMode(8, 'OUTPUT'); a.pinMode(12, 'INPUT'); tic while (toc<10) b=a.digitalRead(12); if ( b==true) a.digitalWrite(8,1); else a.digitalWrite(8,0); end end