Skip to content

Latest commit

 

History

History
71 lines (44 loc) · 2.46 KB

cutebot_case10.md

File metadata and controls

71 lines (44 loc) · 2.46 KB

Case 10: Car Following with A Fixed Distance

Purpose


  • The Cutebot moves with a fixed distance between the car and your hands.

Materials


Software Platform


MicroSoft makecode

Programming


Step 1

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

  • A codebase is required for Cutebot programming, click “Add Package” at the bottom of the drawer, search Cutebot in the dialogue box and download it.

Note: If you met a tip indicating incompatibility of the codebase, you can continue with the tips or build a new project there.

Step 2

  • Drag the "set left wheel speed and right wheel speed" into the On start brick.

Step 3

  • Set a Sonar variable to save the detected Cm value in the Forever brick.
  • If the detected value is between5 and 10 , the car stops moving.
  • If the detected value is below5 , the car reverses because of the short distance with the hands.
  • If not any, the car moves forward to catch up with the hands because of the far distance with the hands and then stay still .

Programming

Links: https://makecode.microbit.org/_YxxfyPVsmHjg

You can also download it directly below:

<iframe style="position:absolute;top:0;left:0;width:100%;height:100%;" src="https://makecode.microbit.org/#pub:https://makecode.microbit.org/_YxxfyPVsmHjg" frameborder="0" sandbox="allow-popups allow-forms allow-scripts allow-same-origin"> </iframe>

Result


  • The Cutebot adjusts itself to keep a fixed distance with your hands.

Exploration


FAQ


Relevant Files