Here i submit a matlab program, which read ASCII values from a serial port to which an arduino board is connected.
for i = 0: 10fclose(instrfindall); %close all serial comms
s=serial('COM25','BaudRate',9600); %start serial port to arduino
fopen(s); %open port
out = fgets(s); %read data from arduino, which waited until start
disp(out) %display arduino data
fclose(instrfindall);end
The program read data successfully,but the problem is, its can't read data synchronously from arduino output port(COM25).(ie, some line of data is missing). kindly give me a solution for this problem and kindly give me a correct code also.
Best Answer