Society of Robots - Robot Forum

Software => Software => Topic started by: nathan25 on November 09, 2007, 10:41:22 PM

Title: PHOTORESISTOR ALGORITHMS
Post by: nathan25 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
Title: Re: PHOTORESISTOR ALGORITHMS
Post by: Admin on November 12, 2007, 03:29:23 PM
Have you searched google for it yet? Or the atom forum (http://forums.basicmicro.net/)?

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