Squirrels have fuzzy tails.
0 Members and 1 Guest are viewing this topic.
void delay_cycles(unsigned long int cycles) { while(cycles > 0) cycles--; }void servo_left(signed long int speed) { PORT_ON(PORTD, 0); delay_cycles(speed); PORT_OFF(PORTD, 0);//keep off delay_cycles(200); }void servo_right(signed long int speed) { PORT_ON(PORTD, 1); delay_cycles(speed); PORT_OFF(PORTD, 1);//keep off delay_cycles(200); }
//detects more light on left side of robot if(sensor_left > sensor_right && (sensor_left - sensor_right) > threshold) {//go left servo_left(44); servo_right(44); } //detects more light on right side of robot else if(sensor_right > sensor_left && (sensor_right - sensor_left) > threshold) {//go right servo_left(25); servo_right(25); } //light is about equal on both sides else {//go straight servo_left(25); servo_right(44); }
good for u airman but those branded servos arent available everywhere
except Ir sensors and other robotics parts
welcome to the forum!Read this http://www.societyofrobots.com/robotforum/index.php?topic=2724.0If you still do not understand I will be happy to go into details
coz geared motors are easier to control than normal motors
By the way it has to be a geared motor
Quote from: superchiku on March 23, 2008, 08:18:52 AMcoz geared motors are easier to control than normal motorsthats not true at allbecause regular DC motors do not have enough torque to drive anything , that is why gears must be added to the regular DC motors.A regular DC motor looks like this
sometimes short explanations dont work do they..
Not to complicate it for you, but airman00 is right, your robot won't work if the motors aren't geared down:http://www.societyofrobots.com/mechanics_dynamics.shtmledit: Also meant to send you this link too:http://www.societyofrobots.com/mechanics_gears.shtml