Recent Changes - Search:

TEAMS Academy Wiki

Explore TEAMS!
for visiting sophomores & juniors

Robotics

EnvBioTech

Bat Design

Assistive Tech


Students


Instructors

TEAMS Forum

TEAMS Calendar

TEAMS Web Site

Wiki Info

edit Student.SideBar

GarciaLab5LightFollow

Light Following

Purpose:

The purpose of this lab was to program the create to find a light source in the room using photo sensors (while it is safe!). This is a useful code to have because it helps with other codes like the Egg Hunt, which also involves the need to light follow.

Results:

The create searches for the light through the excution of wimp mode (15 seconds). The create then rotates in place as it records the highest sensor reading and time it took to get there. Once it has completed the revolution, it will travel that amount of time and drive forward. The create will then continue to excute wimp and repeate the process until unsafe or it has reached the light. (Please see code attached for more details).

Important Lessons Learned:

  • When I first tested different light sourses, I did not expect that the room light would be such a high value.
  • If a white surface (especially if shiny like the back of the line following path) the create will have an extremely high value for the light sensors and will think that it is near light when it is not!
  • In the loop where the create is rotating in place, after it determines the time it took for the highest value, it is slightly off on the angle it should be traveling which is why it was necessary to have a subtraction from the time in the loop.
  • After testing stage is done, it is not necessary to keep updating to get sensor readings because you can add a loop to display one sensor when the time is pos. second and the other to display when neg. This avoids major time delays and makes the code excute in a much more fluid manner.

Flowchart Δ

Code Δ

Edit - History - Print - Recent Changes - Search
Page last modified on January 17, 2008, at 10:56 PM