mBot Instructor's Guide¶
- Try not to drop the robots or step on them
- Warn the students that it is easy to drive off the tables
- All labs that use the motors should be done on the floor
- Avoid remote control lab early in the learning session. Kids just drive around and, although they have fun, they don't learn much computer science. Keep them as a fun reward if they reach a stretch goal.
There are several concepts that we want to teach in these labs:
- Block Programming - this is just like Scratch programming but there are additional block for controlling the robot.
- Events - each key press on the keyboard can be different events and they can run different programs
- Loops - the forever and repeat blocks
- Conditionals - the if
then block is ideal for checking the ping sensor - Reading sensors - We used the ultrasonic sensor on the front of the mBot as a way to read sensor values.
- Functions - We can create abstractions for "drive in a circle" and "drive in a square" by putting them in new blocks.
The mBot Default Programs¶
When you first turn on the mBot they are in one of three "demo" programs:
- Remote control (White) - use the forward, back, left and right buttons on the remote and change the speed with the number_modes
- Collision avoidance (Green)
- line following - Note: no PC is needed for these modes.
Just the mBots and batteries! Each box has a figure 8 course. If we have a white table-top you can put down black tape
Connecting mobile devices to your PC¶
We use the 2.4GHz dongle and the green circle must be on the mBot blocks after you run the Connect/2.4Ghz menu.
Some teaching strategies¶
- try to keep the initial labs simple
- introduce one simple concept at a time
- constantly ask the students for their own ideas of what they want to change. Younger kids want to change colors. Repetition helps them learn and remember.
- try to keep the robots on the desk using the LED labs to start. Keep the motor labs for later in the session
- Avoid the sound labs if the room is too noisy
Here are some "mBot" challenges:¶
Not all students want to follow step-by-step instructions. For these students, just give them a list of challenges and see if they can figure them out the programs themselves.
- Make the LED on the top of the mBot turn red when you hit the spacebar and off when you hit the "o" key
- Make the LED blink continuously using the forever loop - change the speed of the blinking
- Make the color change when you move your hand closer to the mbot
- Bind the forward, back, left and right to the arrow keys
- Make the robot drive a single square
- Make the robot dance - pick a random direction to turn and a random distance to move
- Make the robot go forward unless there is an object in front. Then turn. (Collision avoidance)