Communicate

Bluetooth Transmission

 

🧩 Fun Guide to Bluetooth Transmission Blocks (Clu-blocks Pro)

📶 Important! Bluetooth blocks let your robot talk to other devices — like phones, tablets, or other robots. You can send messages, receive commands, and even check if the connection worked. It’s like giving your robot a walkie-talkie!

#BlockWhat it doesDropdown optionsWhat the options mean
1Bluetooth ble_c Init as Central Device (Host)Sets up your robot as the controllerCentral devices scan and connect to others — like the boss of the Bluetooth network
2Bluetooth ble_p Init as Peripheral Device (Slave) name "Clu-Bots"Sets up your robot as a responderPeripheral devices wait to be connected — like a helper robot
3ble_c Scan BluetoothStarts searching for nearby devicesFinds Bluetooth devices around you — like radar
4ble_c joinBluetooth name "Clu-Bots"Connects to a device by namename, MAC Addressname: connect using device name
MAC Address: connect using unique hardware ID
5ble_c OneNET disconnectedDisconnects from OneNET via BluetoothStops the Bluetooth link to the cloud — useful for switching modes
6ble_x Get local MAC addressGets your robot’s Bluetooth IDUseful for identifying your robot or sharing its address
7ble_x Whether the connection is successfulChecks if Bluetooth is connectedReturns true or false — great for debugging or triggering actions
8ble_x Bluetooth send data body "Clu-Bots"Sends a message over BluetoothYou can send text, numbers, or commands to another device
9Receive message do callback function ble_methodRuns a function when a message is receivedLike saying “when I get a message, do this” — perfect for remote control or chat
10ble_method with: dataDefines what to do with received dataYou can check the message and decide how to respond
11if data = "Clu-Bots"Checks if the message matches somethingGreat for filtering messages — like “if I hear ‘Clu-Bots’, turn on LED”

🧠 Quick Tips for Students

  • Use Central mode to control other devices — like a remote.
  • Use Peripheral mode to be controlled — like a robot waiting for orders.
  • Use send + receive to build chat systems, remote controls, or multiplayer games.
  • Always check connection status before sending — it saves bugs and frustration.
  • Use callback functions to make your robot react instantly — like a Bluetooth reflex!
On this page