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