mBot is from Makeblock company. You can check out their website here.
Software setup and configuration.
- Follow along in class for the introduction to the mBot software and setup.
mBot hardware – Default programs. On board sensors.
- mBot comes with a few built-in programs. We will explore these programs and go over the built-in sensors on the mBot.
Connecting the mBot. Refresh/Restore the mBot to defaults.
- Knowing how to reset the mBot is important. Pay attention to how this is done, you may need to know this if your programs or mBot don’t respond.
- Sometimes a firmware update is required to use the mBot with the latest version of the mBlock software.
Programming the mBot – Your first program.
mBot Introductory Programming Assignments.
For each of these programs, make sure you save a copy of your code. Each program has to be complete, so it needs a way to start and be stopped, either by using the keyboard or on-board button. You can use the IR remote, but you risk interfering with other mBots.
For now, we can only use mBlock while the mBot is tethered over USB.
- Write a control program that uses the arrow keys on your keyboard to drive the mBot. Then, modify your program to be able to adjust the mBot’s speed.
- Write a program that uses the Ultrasonic sensor to detect when something is in front of the mBot. What is the maximum distance that can be detected? The minimum? Have the mBot indicate distance either by using LED brightness or speaker tones.
- Write a program that uses the line follower sensor to play music or tones.
- Write a program that uses the IR sensor to do the following:
- Button 1 operates the LEDs.
- Button 2 plays a song.
- Button 3 makes the robot dance.
- Button 4 makes the robot spin around twice and then move forward until it detects an obstacle, then it stops.
Adding sensors and components to mBot.
- mBot with Me LED Matrix
- Me LED Matrix 8×16 has 128 blue leds packed into 16*8 dot matrix. You can program it graphically via mBlock to display simple animations/text and all kinds of robot emotions.
- First assemble the led face plate according to below illustrations. Then plug the face plate into and empty port on your mCore. Note which port you are using.
- Write the sample script below and run it. Notice the script uses a variable X here. What is the purpose of X?
- Try other scripts. You can display numbers, the time and even drawings.
mBot Maze Solver
For this project you will be building a program that allows your robot to navigate our maze. The class will design/redesign the maze pattern, it must have both left and right turns. 🙂
In order to be successful, you need to use the Ultrasonic and Line Follower sensors together. We will discuss in class what your algorithm will need to do. Here is a link to a YouTube video of the instructor that inspired this project: https://youtu.be/yx6JtQVpcUw
Add the Six-Legged Robot Add-on Pack to your mBot. You will need to test this thoroughly: If the joints are too loose, the legs will jam and the robot will not walk. If the joints are too tight, the robot can’t walk. Find the balance and check the connections every time you run the bot! Revert the bot to stock programming and drive it over Bluetooth or using the IR Remote.
You will be creating a new a program as described my Mr. E once all the groups have built their Bug-Bots.