Hi guys, I have an Arduino Uno board and I want to aquire a signal values from a potentiometer and plot it in realtime, I've found a code to do it as you can se below:
line(nan, nan, 'color','blue');
pot = readVoltage(arduino,'A1');
set(line, 'xData', x, 'yData', y);
The problem is that is gives some several errors when I run the program such as: "Failed to open serial port COM3 to communicate with Arduino board Uno. Make sure there is no other MATLAB arduino object for this board. For troubleshooting, see Arduino Hardware Troubleshooting."
"Invalid pin format. Pin number must be a scalar integer."
I hope someone can help me