Your shopping cart is empty!
CONTROL OMNI ROBOT CAR WITH MOTION:BIT USING BLUETOOTH APP
- Awatif Anuar
- 31 Mar 2023
- Project
- Intermediate
- 1172
Would you like to create a robot to move and respond to your commands? In this tutorial, using a micro:bit and some essential components, you can build a robot that you can control with a Bluetooth app on your smartphone or tablet! Get ready to unleash your creativity and have fun with your very own robot!
Video Tutorial
Components Required
Some cable ties (optional)
Some car cassis (can use any cassis that you have)
Connection
You can refer to the image for a visual representation.
Assemble the motors and wheels on the car cassis.
Connect the motor M1, M2, M3, and M4 to the MOTION:BIT.
To make the structure more stable, you can use cable ties to hold the car cassis.
Code
1. Go to MakeCode Editor. and start a new project.
2. Add the Bluetooth and Motion:bit extensions.
3. Add the following variables: bt_data, TOP_SPEED_A, and TOP_SPEED_B.
4. Add the following functions:
call moveUpperRight
call moveUpperLeft
call backward
call forward
call moveRight
call moveLeft
call spinLeft
call spinRight.
5. Refer to the code block in the picture above.
6. You can also view and edit the code by clicking here!
7. Download the code into your micro:bit.
Bluetooth App
Download the Bluetooth controller app that we will be using.
Connect the Bluetooth app with your micro:bit.
Controlling the robot car:
Open the Bluetooth app.
Press the buttons on the app to control the robot car. Each button corresponds to a function that you have programmed in your code.
Troubleshooting:
If you have trouble connecting the Bluetooth app with the micro:bit, try to connect the Bluetooth on your device setting first with BBC micro:bit [gizet] until it is paired.
Then, try again connecting the Bluetooth app with the micro:bit.