BlocosIA Wiki Editor

Control a robot over Bluetooth

Advanced · Send commands to an Arduino with an HC-05 (Classic Bluetooth) using the arrow keys.

Interactive tutorial: the editor checks each step by itself.

  1. Add the "Classic Bluetooth" extension. (On the Arduino, the HC-05 goes on the RX/TX pins and the program reads Serial.readStringUntil('\n').)
  2. Choose a sprite. Drag "when space key pressed" and change it to "up arrow".
  3. Snap "send over Classic Bluetooth forward" below.
  4. Do the same for the other arrows, sending "back", "left" and "right". (challenge)
  5. To see the robot's reply, use "when a message arrives over Classic Bluetooth" and "say received message".
  6. Pair the HC-05 with the computer (PIN 1234), click "Connect Classic Bluetooth" and choose its port.

Open in the editor