I am new at using Arduino and I need some help with this. I am doing a project involving measuring the focus of an object through a custom built lens. I have a simulink block diagram that gives me a graph on the measure of focus in real time. I would like to send this data to Arduino so that I can analyse the voltage needed for the best focus.
I have used the instrument control toolbox to send this serial data, however it keeps coming up with a timeout error/terminator. Alternatively I tried this code in the command box:
for i = 1:50
fwrite(s, i, 'uint8', 'sync');
rx(i) = fread(s, 1);
This gave an integer error saying I needed a postitive integer.
Can someone help with a code or point me in the right direction please?