Discover Arduino Projects
Hundreds of projects from beginner to advanced — schematics, code, and videos.

mBot Drive Forward and Stop: First Move with the Motors
Press the button on the mBot's board: the robot waits one second, drives straight forward for two seconds and stops. Every press repeats the move. No extra parts are needed. The two motors are plugged into M1 and M2; to go straight the left motor gets a negative speed and the right motor a positive one.

mBot First Drive: Forward, Backward, Right and Left
Press the button on the mBot's board and the robot does the four basic moves in turn: it drives forward, comes back, turns right on the spot and turns left. Each move is a function of its own. No extra parts are needed. In a turn the two wheels spin in opposite directions; the TURN_MS time sets the angle.

mBot Square Drawing Robot: Four Sides with a Loop
Press the button on the mBot's board and the robot draws a square on the floor: it drives along one side, makes a quarter turn to the right on the spot and repeats this four times. It ends where it started. No extra parts are needed. The SIDE_MS time sets the side length and the TURN_MS time sets the turning angle.

mBot Speed Levels: Slow, Medium, Fast
Press the button on the mBot's board and the robot drives forward and back at three speeds: slow first, then medium, then fast. The time is always the same; the higher the speed, the farther the robot goes. No extra parts are needed. The speeds sit in the SPEEDS table: 100, 170 and 255.
