Arduino Matlab Serial Communication

Hallo,

the normal communication between Matlab and my Arduino Uno is good. My Problem is that i can only send one Data to my arduino. To send 2 piece of Data, i have to make a multiple Serial communication.

How can i solve it?

for example: a = Serial.read();
delay(25);
b = Serial.read();

Thank you and sorry for my english skills :slight_smile:

My Problem is that i can only send one Data to my arduino.

Nonsense. Your problem may be that you don't know how to send more than one piece of data at one time, from Matlab. But, that means digging out the documentation for Matlab. It is NOT an Arduino issue.

PaulS:
Nonsense. Your problem may be that you don't know how to send more than one piece of data at one time, from Matlab. But, that means digging out the documentation for Matlab. It is NOT an Arduino issue.

Yes you are right, but how does it Works with the Serial Monitor of the IDE? I want to send 2 or more piece of Data and return them back. If i use Serial.read() only one time, it works fine. But multiple Communication is not working.

I hope you can help me

Please define 'multiple communication'. You're using an Uno. How is it connected to the PC? If it's only via the USB cable, you can only use one PC application at a time to communicate. Either Matlab or Serial Monitor.

Based on the Arduino code you posted, your Arduino side of things might also need some polishing :wink: Read Serial Input Basics - updated to get some ideas.

I want to send two piece of Data from Matlab/Octave or what ever, to my Arduino.

For testing, i wanted to know, how it works when i am using the Serial Monitor. Because even i use the Serial Monitor, i cannot put in 2 Piece of Data :confused:

Read the thread that I linked earlier to get some ideas. No idea about Matlab, but terminal programs (like serial monitor) send text.

Because even i use the Serial Monitor, i cannot put in 2 Piece of Data

Well, I can. There is only one reason that you can't, and that is that you have no idea how to separate the two values.

Enough whining and complaining. Show us an example of what data you want to send, and how the Arduino is supposedtoknowwhereonepieceoffdataendsandthenextonebegins.

And, read that link!