Smart Car examples
Ready-to-open MoBot projects for the Smart Car. Each one is a .mobot file you open in MoBot, with a page that says what to plug in, what to press, and what you should see or hear. See how to run an example if this is your first time. The pins and parts of the Smart Car are on its kit page.
Blocks examples
Section titled “Blocks examples”14 projects made of blocks. Start with the first one in the list. If it does not work, the problem is the board, the firmware or how the program was sent, not your program.
| Example | What it is about |
|---|---|
| Blink the LED | LED 1 turns on for half a second, off for half a second, forever. |
| Which way do the wheels turn? | Drives both wheels one way, then the other, then spins on the spot — with the speed set separately from the direction. |
| Speed ramp | Both wheels climb from 20 % to 100 % and back to a stop, over and over, using the one block that sets direction and speed together. |
| LED dimmer | LED 1 fades up and down while LED 2 stays hard on, so you can see the difference between brightness and on/off. |
| Sound machine | Plays four of the built-in tunes one after another, then proves the Stop block really can cut a song off in the middle. |
| Follow the line | Reads the five line sensors, drives forward only while the middle one is over the line, and prints what the sensors see. |
| Stop before you hit it | Drives forward while the way is clear and backs away with a warning sound when the ultrasonic sensor sees something within 15 cm. |
| What colour is that? | Prints the raw red, green and blue readings from the colour sensor and lights an LED when what it sees matches the colour you typed in. |
| Servo sweep | Wakes up the servo motors and swings servo 1 between 0, 90 and 180 degrees, over and over. |
| Drive it from the phone | Renames the robot, shows on an LED whether the phone is connected, drives on the D-pad buttons and prints the joystick position. |
| Joystick controls the speed | Stretches the Game Pad’s stick reading into a 0-100 % wheel speed with the map values block. |
| Talk to a pin directly | Switches the two LED pins fully on and off, then brightens one of them in three PWM steps, using the Pins blocks instead of the LED blocks. |
| Read a pin | Prints the raw 0 or 1 of one input pin about three times a second, so you can cover a sensor with a finger and watch the number change. |
| Check the battery | Prints the battery’s voltage every two seconds and lights LED 2 when it falls below 6.5 V. |
Python examples
Section titled “Python examples”7 projects written in MicroPython, for when dragging blocks is not enough, and for the parts of the firmware that no block can reach. Every one has two versions, one for firmware 3.0 and one for firmware 2.x, in tabs on its page.
| Example | What it is about |
|---|---|
| Drive a square | Direct motor control in Python: a speed ramp with the robot in the air, then four sides and four corners. |
| Sensor check | Reads every sensor the robot actually has, once a second, and says which ones failed to wake up. |
| Find north | Calibrate the compass, read the heading, then let the robot turn itself to face north. No block can do this. |
| Servo arm and joystick | Wake the servos and the joysticks, sweep a servo horn, then steer it live with a joystick. |
| Song and lights | Play, pause, resume and speed up the buzzer while both LEDs breathe - and write your own tune. |
| Name your robot, then drive it | Rename the robot for good, then read the phone’s Game Pad yourself and decide what the wheels do. |
| Line follower (4 files) | A program split across main.py, eyes.py, wheels.py and settings.py - the robot follows black tape. |