PROBLEM-Sent a string from Matlab to Arduino


hi everyone. try sent string matlab arduino have no success.
the matlab code is:

code: [select]


s = serial('com3','baudrate',9600); % start serial port
fopen(s);                                    %open connection


 %sent string s

 invmsg = char('<',num2str(th1g(k)),num2str(th2g(k)),'>'); %where th1g(k) , th2g(k) float
 fprintf(s,invmsg);


 fclose(s);
 delete(s);


for arduino's code, idea memorize num2str(th1g(k)) , num2str(th2g(k)) in 2 dimensional array. convert elemnts in float. don't know it.
thank lot me , sorry imperfect english. :)

i don't know matlab. examples in serial input basics should on arduino side. there parse example.

...r


Arduino Forum > Using Arduino > Interfacing w/ Software on the Computer > PROBLEM-Sent a string from Matlab to Arduino


arduino

Comments