I am trying to interface an Arduino Nano CH340 with Matlab but keep getting this error:
Error using ArduinoMatlabExampleYT (line 11)
Cannot program board Nano33BLE (COM3). Please make sure the board is supported and the port and board type are correct. For more information, see Arduino Hardware Troubleshooting.
I tried Nano3
, Nano33IoT
, and Nano33BLE
, but all failed. below is the basic code in Matlab.
Also, the Arduino package is installed.
clear
clc
close all
ledPin = 'D13';
deltaT_blink = 0.5;
port = 'COM3';
board = 'Nano3';
a = arduino(port, board);
for k=1:10
a.writeDigitalPin(ledPin,0);
pause(deltaT_blink/2);
a.writeDigitalPin(ledPin,1);
pause(deltaT_blink/2);
end
Am I doing something wrong?