19. Case15: Seeking the Light#

19.1. Purpose#


  • Programme to make the Cutebot seek the light source automatically.

19.2. Materials#


19.3. Software Platform#


MicroSoft makecode

19.4. Programming#


Step 1#

  • Click “Advanced” in the MakeCode drawer to see more choices.

../../_images/cutebot-pk-13.png

  • We need to add a package for programming, click “Extensions” on the bottom of the drawer and search with Cutebotin the dialogue box to download it.

../../_images/cutebot-pk-111.png

Note: If you met a tip indicating the codebase will be deleted due to incompatibility, you may continue as the tips tell or build a new project.

Step 2#

  • Judge the luminous intensity with the block “light level “ in “forever” ; if the value is below the setting point, set the Cutebot turn left at its full speed; Or it moves forward at its full speed.

../../_images/case_15_011.png

19.5. Result#


  • The Cutebot spins if there is no light being detected or it drives forward to it at its full speed.

19.6. Exploration#


19.7. FAQ#


19.8. Relevant Files#