Setup and Configure Arduino Hardware

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:

Connection over USB

Arduino hardware communicates with the host computer via a USB cable as shown:

To configure your Arduino hardware to communicate via USB:

  1. Connect Arduino hardware via USB, and choose the connection type USB.

  2. 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.

  3. After the upload has completed, click Test connection to test the connection between your host computer and the Arduino board.

  4. Click Finish to complete the hardware setup. To connect to your Arduino board, see Connect to Arduino Hardware.

Connection over Bluetooth

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:

  1. Connect Arduino hardware via USB, and choose the connection type Bluetooth.

  2. 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.

  3. 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.

  4. 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.

  5. After you have successfully paired your Bluetooth device, click Test connection to test the connection between your host computer and the Arduino board.

  6. Click Finish to complete the hardware setup.

Connection over WiFi

Arduino hardware communicates to the host computer via WiFi after the setup, as shown:

To configure your Arduino hardware to communicate via WiFi:

  1. 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.

  2. Choose the board type as MKR1000 or MKR1010 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.

  3. After the upload has completed, click Test connection to test the connection between your host computer and the Arduino board.

  4. Click Finish to complete the hardware setup.

See Also

Related Topics