Case 2 - Detect the black color

Part 1   Objective

After you compile the program, the stage displays whether the line follower sensor detects the black color in real time.

6.gif

Part 2   Preparation

  • MegaPi x 1

  • MegaPi RJ25 adapter x 1

  • Line follower sensor x 1

  • RJ25 cable x 1

  • USB cable (Type-B) x 1

  • Computer with network access x 1

Install the MegaPi RJ25 adapter on MegaPi, connect the line follower sensor to MegaPi by using the RJ25 cable, 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 Live mode.

7.gif

8.gif

Update the firmware of Ultimate 2.0.

9.gif

Part 3   Programming

After you turn on Ultimate 2.0, the stage displays whether the line follower sensor detects the black color in real time.

10.gif

Part 4   Practice

Try to detect the white color.

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

Comments

0 comments

Please sign in to leave a comment.