Slideshow

Traffic light robot

We got started this week and depending on the class we built and programmed  a combination of the following robots. The beginners kids built the RV2 robot and then programmed it to do the following basic programs.

The advanced kids also built the RV2 robot, but added 2 colour sensors and an ultra sonic sensor and then programmed the robot to negotiate one of the obstacles that an autonomous car would have to negotiate, namely a traffic light. Currently the light only has red and green phases. Here is a video of this exercise in action as well as the code.

The basic logic of the code is as follows:

  1. If light is green the robot keeps going.
  2. If the light is red, then the robot slows down and proceeds to the line at the traffic light and then stops.
  3. If there is anthing in the way, then always stop.

 

 

You Might Also Like