Case 24 - Robotic Ant (II)

Part 1   Objective

Write a program to make the Robotic Ant turn.



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 a 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 or web version), click +add, select Ultimate 2.0 from the Device Library, click Connect, and select the Upload mode.


Part 3   Programming

In Upload mode, when Ultimate 2.0 (MegaPi) starts up, the Robotic Ant stops moving and starts turning left and right 2 seconds later. The Robotic Ant turns left for 3 seconds and then turns right for 3 seconds, and repeats this process.


Part 4   Practice

Try to add moving forward and backward to the program to make the Robotic Ant move forward, backward, left, and right, looking like it is dancing.
Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.