Using the Preset Programs of mBot Mega

Note: Update the firmware of mBot Mega to the factory version before using the preset programs. For details about firmware update, see About mBot Mega.

Function switching:

Press any one of the impact switches for 2 seconds to switch between different preset functions. The color of the RGB LEDs indicate the function being used:

Green: gesture recognition

Yellow: obstacle avoidance

Blue: line following

 

mceclip1.png

 

Gesture recognition: default function at boot

mceclip1.png

  • LED color: green
  • Standby state: Both RGB modules are all in dark green.
  • When the obstacle avoidance sensor detects an obstacle, the RGB LEDs change to bright green.
  • The three obstacle avoidance modules assembled in the front can detect three states within 3-10cm:
    • Swiping to the right: When the obstacle avoidance sensors 3, 2, or sensors 2, 1 detect signals successively, the robot moves about 10cm to the right. When the robot moves, the RGB LEDs on the right side are lit up in bright green, and when the robot stops, it returns to dark green.
    • Swiping to the left: When the obstacle avoidance sensors 1, 2, or sensors 2, 3 detect signals successively, the robot moves about 10cm to the left. When the robot moves, the RGB LEDs on the left side are lit up in bright green, and when the robot stops, it returns to dark green.
    • Pushing: When obstacle avoidance sensors 1 and 3 detect signals at the same time for more than 0.2 seconds, it is judged as a pushing gesture, the left and right RGB LEDs are lit up in bright green, and the robot moves backward.
  • Stop moving when all the sensors fail to detect the signal, and the RGB LEDs return to dark green.

Gesture-recognition-demo.gif

Automatic obstacle avoidance:

  • LED color: yellow
  • When no obstacle is detected, all LEDs are lit in dark yellow.
  • When any infrared sensor detects an obstacle, all LEDs are lit up in bright yellow.
  • After switched to automatic obstacle avoidance mode, it moves according to the state of three sensors:
    • Forward: moves forward when none of the three sensors detect obstacles
    • Turn left: When the sensor on the left detects an obstacle, it rotates clockwise about 90 degrees on the spot.
    • Turn right: When the sensor on the right detects an obstacle, it rotates about 90 degrees counterclockwise on the spot.
    • Backward: When the middle sensor detects an obstacle, it moves backward about 5cm.

Automatic-obstacle-avoidance.gif

Automatic line-follow:

  • LED color: blue
  • When the line-following sensor does not detect black line, the RGB LEDs are lit up in dark blue.
  • When the line-following sensor detects a black line, the RGB LEDs on the corresponding side are lit up in bright blue.
  • After switched to the line-following mode, the robot starts line following when any line-following sensor detects a black line; if the two line-following sensors cannot detect black lines, the robot rotates in place for 5 seconds until a black line is detected and then starts line-following. If no black line is detected after 5 seconds, the robot stops the movement and waits for the black line to be detected again and then starts line following (waiting to be manually moved to a black line).

Automatic-line-follow.gif

 

Was this article helpful?
1 out of 2 found this helpful

Comments

0 comments

Please sign in to leave a comment.