Author Topic: object avoidance photovore  (Read 2103 times)

0 Members and 1 Guest are viewing this topic.

Offline quickflameTopic starter

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
object avoidance photovore
« on: October 15, 2009, 07:15:24 PM »
is it possible to add an ability to a photovore/light follower robot to have an ability to avoid objects?
and how woud this be attained???  has anyone did this before? any help woud be appreciated (ideas,schematic diagrams, programming) thanks!

Offline parallax

  • Full Member
  • ***
  • Posts: 94
  • Helpful? 1
Re: object avoidance photovore
« Reply #1 on: October 16, 2009, 09:47:56 AM »
If you give the range-finding sensor priority over your photoresistors in the code you'll be all set. This can be achieved with an if-else statement in the main loop of your program. Here's some example psuedo-code:

if (object is to close){
Other code here

If the first condition is true then the robot will skip the light seeking (or fleeing depending if your building a photovore or a photophobe) and go into whatever avoidance routine you program. Otherwise it will continue to love or hate the light.  ;)

Hope that helps!
"Less than a drop of blood in me remains that does not tremble;
I recognize the signals of the ancient flame"


Get Your Ad Here