Society of Robots - Robot Forum
Electronics => Electronics => Topic started by: MasterRyko on June 18, 2007, 10:09:32 AM
-
I am building a robot that follows light. I have a two motor setup with the front motor being a servo that controls either going left or right, and a rear drive motor. My plan is to use 2 photoresistors to control the servo for steering, and a Sharp IR range finder to control the rear motor so that if it comes to close to the light source it will stop automatically. Does sound like a logical design?
-
It's more common to see the two motors on either side of the robot (left and right), with each motor increasing or decreasing speed relative to the other to make it turn one direction or the other. In other applications it also allows a zero-point-turn.
It should work, more or less, but be advised that a wheel configuration such as this will mandate a "turning radius" which may cause problems in some circumstances.
I'm interested in seeing a picture of your "motorcycle-like" wheel configuration.
-
if it must only travel on a flat surface maby it could be a 3 wheeler, 2 drive wheels in back and a servo driving a 3rd steering wheel
-
http://www.societyofrobots.com/programming_differentialdrive.shtml
and a Sharp IR range finder to control the rear motor so that if it comes to close to the light source it will stop automatically.
This will work.
Another method I have used is this:
if (light_sensors detect a really bright light) // robot is close to light source
then stop_motor();
-
http://www.societyofrobots.com/programming_differentialdrive.shtml
and a Sharp IR range finder to control the rear motor so that if it comes to close to the light source it will stop automatically.
This will work.
Another method I have used is this:
if (light_sensors detect a really bright light) // robot is close to light source
then stop_motor();
How would you do this : if (light_sensors detect a really bright light) // robot is close to light source
then stop_motor();
so far my coding for my photoresistors looks like this:
int main(void)
{
int sensor_left=0;
int sensor_right=0;
int threshold=4;
while(1)
{
sensor_left=a2dConert8bit(5);
sensor_right=a2dConvert8bit(4);
if(sensor_left > sensor_right && (sensor_left - sensor_right) > threshold)
{
PORTD |=1<<PD2;
PORTD &= !(1<<PD1);
PORTD |=1<<PD4;
}
else if(sensor_right > sensor_left && (sensor_right - sensor_left) > threshold))
{
PORTD &=!(1<<PD0);
PORTD |=1<<PD3;
PORTD |=1<<PD4;
}
}
One other question I have is, If i set a port to low, is it considered to be grounded? If not, is there a way to set a port to ground?
Thanks
-
How would you do this
http://www.societyofrobots.com/downloads/sbs_source_photovore_v1.zip
One other question I have is, If i set a port to low, is it considered to be grounded?
For all intents and purposes, yes.