I have a class that makes primary use of Matlab, and we have a final project. My first problem is making an LED flash at a certain frequency, which will later be used as a means of communication with another ARD UNO board. I've tried "pause" from MATLAB, but it's not accurate enough for flashing an LED at X frequency. I've tried using "a.delay(___)", but MATLAB doesn't recognize it, even with the proper porting code. Has anyone had issues like this before? Or does anyone have code that can do this?
if exist('a','var') && isa(a,'arduino') && isvalid(a) %arduioey bits
else
a=arduino('COM4');
end
x = 1;
a.pinMode(8,'OUTPUT')
while x == 1
a.digitalWrite(8,1)
a.delayMicroseconds(1000) %MATLAB doesn't like this part. It's happy with it's own equivalent, "pause".
a.digitalWrite(8,0)
a.delayMicroseconds(1000)
end