Pi Supply bit:buggy Project 08 – Light follow

In this project we are going to make the bit:buggy follow a single light source such as a torch light or the light on your phone. As you move the light source the bit:buggy will follow and change direction according.

Connect your hardware

If you haven’t done so already, connect the left servo wheel to P1 and the right servo wheel to P2.

Coding

Step 1 – Snap in place the block “go straight at full speed” into the “On start” block. The port number is the actual servo connection port.

Step 2 – Snap the light level from the Input. The car will move to the light source when the light level is greater than the defined value. The car will spin around to find the light source when the light level is less than the defined value.

Step 3 – Upload your program to the bit:buggy

Program link – https://makecode.microbit.org/_Ds9Fss3c6Mbt

 Action

The car initially will spin around and then follow the nearest and brightest light source.

Project Examples

  • Project 01 – Full speed ahead
  • Project 02 – Make a shape
  • Project 03 – Turn at an angle
  • Project 04 – Here comes the police
  • Project 05 – Crazy dance
  • Project 06 – Remote control
  • Project 07 – Turns over detection
  • Project 08 – Light follow
  • Project 09 – Remote control by an accelerometer
  • Project 10 – Smart crashproof car

 

First published at 4:56pm on October 30, 2019
Last updated at 6:26pm on November 14, 2019