Main Content

Connect a Host Computer Running macOS to an EV3 Brick Using Bluetooth

This example shows how to connect the MATLAB® software running on a Mac computer to an EV3 brick over a Bluetooth® connection.

Required hardware: A compatible USB Bluetooth dongle or a host computer with built-in Bluetooth.

  1. On the Mac computer, edit the Bluetooth settings. Enable Bluetooth and make the computer visible to other devices.

  2. In the EV3 interface, under settings, select Bluetooth.

  3. Enable Bluetooth and Visibility. Then, select the large check mark.

  4. Confirm that Bluetooth is enabled.

  5. On the Mac computer, add the EV3 brick to the list of Bluetooth devices.

  6. On the EV3 interface, when you see Connect?, select the check mark.

  7. On the EV3 interface, read the PASSKEY value (default: 1234) and select the check mark.

    Ignore the underscore character at the end of the passkey value.

  8. On the Mac computer, enter the passkey value as the Bluetooth pairing key.

  9. Get the device name of the serial port connection to the EV3 brick. Open Terminal in macOS and enter:

    ls /dev/tty*
    /dev/tty.EV3-SerialPort
  10. In the MATLAB Command Window, use the legoev3 function to connect to the EV3. Specify the connection type, Bluetooth, and the device name of the serial port connection to the EV3 brick.

    myev3 = legoev3('Bluetooth','/dev/tty.EV3-SerialPort');