Case 7 - Display the battery level

Part 1   Objective

After you upload the program, Codey's screen displays its current battery level.

24.jpg

Part 2   Preparation

  • Codey (robot controller) x 1

  • USB cable x 1

  • Computer with network access x 1

Connect Codey to the computer by using the USB cable, open mBlock 5 (PC client or web version), delete the default device, click +add, select Codey from the Device Library and then click Set as mostly used device in the upper left corner, click Connect, and select the Upload mode.

25.gif

26.gif

Part 3   Programming

Use the battery level block in Sensing blocks and the show ( ) block in Looks blocks, and click Upload to display the battery level in real time.

27.gif

Part 4   Practice

Try to make Codey play a specific sound when it is fully charged.

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

Comments

0 comments

Please sign in to leave a comment.