int move_bot() { init_sensor_values(); while(checkobstacle()==0) {} buzzer_off(); if(checkintersection() == 1) { //communicate with coordinator comintersection(); stop(); _delay_ms(100); return 0; } else { follow(); return 1; } }
void checkfollow(void) { int temp12=0; while(1) { init_sensor_values(); while(checkobstacle()==0) {} if(checkintersection() == 1 ) { temp12++; if(temp12==2){ turn_left(); temp12=0; } else follow(); } else { follow(); } } }