Case 23 - Robotic Ant (I)

Case 23 - Robotic Ant (I)

 

Part 1   Objective

Write a program to make Robotic Ant move forward and backward.

79.gif

Part 2   Preparation

  • Mechanical parts and electronic modules of Robotic Ant

  • USB cable (Type-B) x 1

  • Computer with network access x 1

Follow the building steps to build Robotic Ant. Install the MegaPi encoder/DC motor drivers on MegaPi, connect the motors to the motor ports on MegaPi by using the motor cables, connect MegaPi to the computer by using the USB cable, open mBlock 5 (PC client, web version, or mobile app), click +add, select Ultimate 2.0 from Device Library, click Connect, and select the Upload mode.

80.gif

Part 3   Programming

In Upload mode, when Ultimate 2.0 (MegaPi) starts up, Robotic Ant stops moving and starts moving forward and backward 2 seconds later. Robotic Ant moves forward for 2 seconds and then moves backward for 2 seconds, and repeats this process.

81.gif

Part 4   Practice

Try to set different power values and durations for Robotic Ant to move forward and backward, and see what the difference is.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.