Matlab and Arduino interfacing using serial communication


i have interfaced matlab , arduino , written code .i checked serial communication first using serial monitor returns result monitor when attached matlab opening com port matlab , creating arduino object serial communication arduino.when write command of sending data arduino

fprintf(arduino,'%d',d)

the arduino doesnot respond , not print on lcd while when send serial monitor prints , secondly have built function of sendserial in matlab send data arduino.but when write individually command fprintf(arduino,'%d',d) on command window of matlab condition in arduino sketch if recieve 31 turns on led pin 13 responds , turn on led.please me problem?
but doesnot call fucntions in arduino sketch when recieving data.

here arduino code


void loop()
{
 int b[6]={
   0,0,0,0,0,0        };    
 if(serial.available()>0) // if there data read
 {

   matlabdata=serial.parseint() ;
   dec2bin(matlabdata,b);
   sprint(b);


 }

}

these function not called when recieves data form matlab functions sendserial

 matlabdata=serial.parseint() ;
   dec2bin(matlabdata,b);
   sprint(b);


sprint(b) function prints data lcd

quote
these function not called when recieves data form matlab functions sendserial
you've provided no proof of that. you've not shown of code. did post, posted incorrectly. you've not said whether or not rx led blinks. you, therefore, can not reasonably expect help.


Arduino Forum > Using Arduino > Interfacing w/ Software on the Computer > Matlab and Arduino interfacing using serial communication


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code