go away spammer

Author Topic: PHOTORESISTOR ALGORITHMS  (Read 3270 times)

0 Members and 1 Guest are viewing this topic.

Offline nathan25Topic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
PHOTORESISTOR ALGORITHMS
« on: November 09, 2007, 10:41:22 PM »
Okay,
I'm using the Basic ATOM 28- Pin. And I am planing on using the PHOTORESISTOR ALGORITHMS meathod for obstalce avoidance.
This Code:
read left_photoresistor
read right_photoresistor
if left_photoresistor detects more light than right_photoresistor
then turn robot right

if right_photoresistor detects more light than left_photoresistor
then turn robot left

if right_photoresistor detects about the same as left_photoresistor
then robot goes straight

loop

can it be "translated" into the language that the Basic ATOM uses for programing?
and also what would be the the code for steering if i used a rear axel drive, with a motor at the front that steers the car by going forward or reverse... for the motor control i have a Sabertooth 2x5 motor drive pinout (motor controller)

Thnxs Nate
I design robots to take ovr the Universe

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: PHOTORESISTOR ALGORITHMS
« Reply #1 on: November 12, 2007, 03:29:23 PM »
Have you searched google for it yet? Or the atom forum?

Im sure there is Atom photovore source code out there . . . shouldn't the manual have it? Its like the 'hello world' of robot programs . . .

Quote
what would be the the code for steering if i used a rear axel drive, with a motor at the front that steers the car by going forward or reverse... for the motor control i have a Sabertooth 2x5 motor drive pinout (motor controller)
the sabertooth can take a regular servo signal, so just use the same code as with a servo

 


Get Your Ad Here

data_list