Once you have installed the support package,
as described in Install the Support Package, you can configure communication
between the host computer and the Arduino® board. Type arduinosetup
in the MATLAB® Command Window, and choose one
of the following connection types:
Arduino hardware communicates with the host computer via a USB cable as shown:
To configure your Arduino hardware to communicate via USB:
Connect Arduino hardware via USB, and choose the connection type USB.
Choose the board type and the port number from Choose
board
and Choose port
. Also,
select the libraries that you want to include in your Arduino server.
Click Program to begin uploading the server to
your Arduino board.
After the upload has completed, click Test connection to test the connection between your host computer and the Arduino board.
Click Finish to complete the hardware setup. To connect to your Arduino board, see Connect to Arduino Hardware.
Note
Instrument Control Toolbox software is required to connect to an HC-05 or HC-06 Bluetooth® module.
Arduino hardware communicates with the host computer via Bluetooth after the setup, as shown:
To configure your Arduino hardware to communicate via Bluetooth:
Connect Arduino hardware via USB, and choose the connection type Bluetooth.
Choose the board type and the port number from Choose
board
and Choose port
. Also,
select the libraries that you want to include in your Arduino server.
Click Program to begin uploading the server to
your Arduino board.
Select the Bluetooth device that you want to
use to communicate with Arduino board. If you are using HC-05 or HC-06
and have not configured the device using the arduinosetup
interface,
click No to first configure your Bluetooth device.
Once you have configured your Bluetooth device,
follow the on-screen links in arduinosetup
interface
to pair your Bluetooth device and get your Bluetooth serial
port or address.
Note
If you are using a Windows® desktop computer, connect a Bluetooth dongle to your computer.
After you have successfully paired your Bluetooth device, click Test connection to test the connection between your host computer and the Arduino board.
Click Finish to complete the hardware setup.
Arduino hardware communicates to the host computer via WiFi after the setup, as shown:
To configure your Arduino hardware to communicate via WiFi:
Connect Arduino hardware via USB and choose the connection type WiFi. Choose the encryption type of your WiFi network, and enter the necessary credentials.
If you have previously configured your Arduino board
using WiFi via the arduinosetup
interface, you
can select the Retrieve last configuration from Arduino board
,
which retrieves the necessary credentials from your previous configuration.
If you check the Use static IP address box, make sure that you use an available static IP address and that your router allows the usage of static IP.
Note
Ensure that the Subnet Mask
is 255.255.255.0
and
the Default Gateway
is the IP address of the network
gateway.
Choose the board type as MKR1000
, MKR1010
or
Nano33IoT
and its port number. Also, select the libraries that you
want to include in your Arduino board. Click Program to begin uploading the server to
your Arduino board.
After the upload has completed, click Test connection to test the connection between your host computer and the Arduino board.
Click Finish to complete the hardware setup.