Bluetooth Connection Block

Use the Bluetooth Connection block to turn Bluetooth on or off, connect to another Bluetooth device, or close the connection to another Bluetooth device. Bluetooth devices include other EV3 Bricks, cellular phones, and computers although not all Bluetooth devices will support a connection to the EV3 Brick. If you have already established a Bluetooth Connection using the EV3 On-brick menu, you do not need to use the Bluetooth Connection Block.
The Bluetooth protocol in the EV3 system works by choosing a Master EV3 Brick and using that to connect to a Slave EV3 Brick. One Master EV3 Brick can connect to up to seven Slave EV3 Bricks. The Master EV3 Brick can send messages to each Slave EV3 Brick. The Slave EV3 Bricks, however, can only send messages back to the Master EV3 Brick. Slave EV3 Bricks cannot send messages directly to other Slave EV3 Bricks.

After a Bluetooth connection has been made, the program can send and receive messages. See the Messaging Block for more information.



Mode Selector
Input

Use the Mode Selector to select the Bluetooth connection mode you want. After selecting the mode, you can choose a value for the input. The input available will change depending on the mode.
Modes
On


The On mode will turn on Bluetooth on the EV3 Brick running the program.
Off


The Off mode will turn off Bluetooth on the EV3 Brick running the program.
Initiate


The Initiate mode initiates a connection with a specified Bluetooth device. Use the Connect To input to enter the device name. A Bluetooth connection is maintained until the Close Connection mode is used.
Close


Use the Close mode to end a connection with a Bluetooth device.
Example
This program will connect to another EV3 Brick called Kim. The program sends the message “Hello” when the state of the Touch Sensor is changed.
Inputs
You can enter the input values directly into the block. Alternatively, the values can be supplied by Data Wires from the output of another Programming Block.
InputsTypeNotes
Connect To TextSpecifies the Bluetooth device that a connection will be initiated with, or for which the connection will be closed.
Bluetooth Connection
Quick links