Go Down

Topic: from MATLAB to arduino to another serial object (Read 1 time) previous topic - next topic

davince

Hello, everyone.
I'm Paul and a beginner in MATLAB and arduino.
I have been using matlab guide program to control two devices.
1.relay for microscope power using arduino
2. serial to control motorized stage.
3.3rd party software to control a DSLR

Now I want to use arduino to also do the serial transmission to motorized stage.
But i don't quite know if matlab arduino i/o package can use softwareserial library in arduino.
I am using arduino mega2560 and it's always connected to the pc.
so i know pin 0 and 1 for rx and tx cannot be used.

I hope i can wire another UART to other serialport on arduino. and connect the motorized stage to arduino through this new rs232.
I just don't know if i can send serial text to the new serialport through arduino i/o package in MATLAB.

Can someone give me some guide if this is possible?

Very much thanks in advance

best,
Paul

PaulS

Quote
But i don't quite know if matlab arduino i/o package can use softwareserial library in arduino.

It can't. But, on a Mega with 4 hardware serial ports, why would you need/want to?

Quote
I hope i can wire another UART to other serialport on arduino. and connect the motorized stage to arduino through this new rs232.

You can.

Quote
I just don't know if i can send serial text to the new serialport through arduino i/o package in MATLAB.

You can't. You can send data to the Arduino on Serial, and let it do some work. It doesn't have to be an idiot-savant for you.

It can parse the data you send, and see that it is for another device, and pass it to that device using a SerialX instance.
The art of getting good answers lies in asking good questions.

davince


Go Up