Case 6 - Display the ambient light intensity

Part 1   Objective

After you upload the program, Codey's screen displays the current light intensity. Codey's light sensor is at the small hole in the lower right corner.


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.



Part 3   Programming

Use the ambient light intensity block in Sensing blocks and the show ( ) block in Looks blocks, and click Upload to display the ambient light intensity value in real time.


Part 4   Practice

  1. Try to record the outdoor light intensity values at different time points of a day.

  2. Try to make Codey detect and tell whether it is in the daytime or at night.

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



Please sign in to leave a comment.