Can arduino receive and send information through its serial port to a simulink model on a pc?

2 visualizzazioni (ultimi 30 giorni)
Hey, I tried to implement the fuzzy logic controller on the arduino uno and it doesn't work. Is it possible to run the controller on my pc and use serial receive and serial transmit to read the sensors on the arduino and give commands to the actuators?

Risposte (1)

Valmir Sadiku
Valmir Sadiku il 28 Mag 2013
Of course, i tried that in the past and it works fine with the 'Serial Receive'- and 'Serial Send'-Blocks. You can run into trouble, because of your restrictions regarding the sample time. Therefore you have to use Real-Time Windows Target.
  2 Commenti
damon
damon il 28 Mag 2013
Thank you for responding. Can you give me further instructions on how to go about using the real time windows target toolbox to send and receive data on the arduino uno? I attempted to send and receive data by using the embedded encoder toolbox and the instrumentation tool box but there seems to be an error with the serial port. The serial configuration block keeps indicating that no ports are available.
Valmir Sadiku
Valmir Sadiku il 28 Mag 2013
As you noticed, the serial configuration block keeps indicating that no ports are available. I solved this problem by first plug-in the arduino then restart MATLAB, after that the port should be available. You can use the 'Stream Input'-Block from the real time windows target toolbox, and select an standard device.

Accedi per commentare.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by