Software > Software
PHOTORESISTOR ALGORITHMS
(1/1)
nathan25:
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
Admin:
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)
--- End quote ---
the sabertooth can take a regular servo signal, so just use the same code as with a servo
Navigation
[0] Message Index
Go to full version