Squirrels have fuzzy tails.
0 Members and 1 Guest are viewing this topic.
This servo can operate 180° when given a pulse signal ranging from 600usec to 2400usec. Since most R/C controllers cannot generate this wide of signal range, you will need to use our servo stretcher for 180° operation.
int scan_angle=10;//position of scanner, in units of servo commandint max_scan_angle=56;//maximum position scanner can rotate to (57)
if (sharp_IR_reading > scan_thresh)//object detected { if (scan_angle>41) //overflow protection << HERE scan_angle-=2;//scan right }
while(1) { scan(); //object on left if(scan_angle > 57) << SET THIS TO YOUR max_scan_angle VALUE robot_turn_left(); //object on right else if(scan_angle < 41) << AND THIS TO YOUR NEW LOWER LIMIT robot_turn_right(); //object is centered else robot_go_straight(); delay_cycles(400);//a small delay to prevent crazy oscillations }
int max_scan_angle=56;//maximum position scanner can rotate to