Hi all,
I'm using a arduino R3 board connected to matlab and I have a problem of connection now. This is the code I use to build up the connection :
a = arduino ('COM3');
When I start Matlab and run the single line in command window, the connection is perfectly successful. Then if I try to run a script which only has the single line to enable the arduino board, the connection is successful as well.
However, if I start Matlab and run the script with the single line first, it shows 'attempting connection.........' and then 'connection unsuccessful, please make sure that the board is powered on, running a sketch provided with the package, and connected to the indicated serial port. You might also try to unplug and re-plug the USB cable before attempting a reconnection. ' But sketches can still be uploaded to the board via arduino software.
This looks really strange to me. To me, that makes no difference to run the line in command window in Matlab first and run the script in Matlab first. Or is there a difference to run codes in command window and script?
I'll be well appreciated for all your kind suggestions and ideas ! Please let me know!
Cheers,
Olivia