Buy an Axon, Axon II, or Axon Mote and build a great robot, while helping to support SoR.
0 Members and 1 Guest are viewing this topic.
while(1) { ping(); //Object Avoider if (PingVal > 8) { scan(); //if (sharp_IR_reading > scan_thresh) { //object on left // if(scan_angle > 456) // 57 * 8 // robot_turn_right(); //object on right // else if(scan_angle < 328) // 41 * 8 // robot_turn_left(); // } // end if //object is centered //else robot_go_straight(); } // end if else { while (PingVal < 16) { robot_go_back(); ping(); } // end while } // end else
robot_go_straight();else while (PingVal < 16) robot_go_back(); ping();
robot_go_straight();else while (PingVal < 16) robot_go_back(); delay_ms(500);//give it time to go in reverse robot_rotate_left();//if it doesn't turn, it just goes forward into object again ping();
Its only with going forward that causes it to jerk.
I tried attaching it to a timer, but you can't use functions that receive or return values.
while(1) { ping(); scan();...
while(1) { ping(); //scan(); if (PingVal > 8) { scan(); robot_go_straight(); } // end if ...
using only ping or scan in the code by themselves and it works fine.
while(1) { ping(); //scan();
while(1) { //ping(); scan();
while(1) { ping(); scan();
hey i just realized, isnt fuzzy the omniwheeled robot doing scanning and sonar at the same time?