Implementation/main.c
void park_mode2(uint32_t UT2_avg)
{

	if (UT1_avg < 5)		// turn back right to locate right place
	{
		wheel(&pwm_motorBA, &pwm_motorBB, BACK, 70); // direction of two motor
		wheel(&pwm_motorAA, &pwm_motorAB, BACK, 30); // direction of two motor
	}
	else					// move backward within the found parking lot according to the park_mode 1
	{
		wheel(&pwm_motorBA, &pwm_motorBB, BACK, 5); // direction of two motor
		wheel(&pwm_motorAA, &pwm_motorAB, BACK, 40); // direction of two motor
		park_count3++;
	}
	if (park_count3 > 45)	// move to the park mode 3
	{
		mode = 3;
	}

}
// Park mode 2 to turn back in the parking lot 

Park mode 2 to turn back in the parking lot
Park mode 2 to turn back in the parking lot
void park_mode2(uint32_t UT2_avg)
{
	if (UT1_avg < 5)		
	{
		wheel(&pwm_motorBA, &pwm_motorBB, BACK, 70); 
		wheel(&pwm_motorAA, &pwm_motorAB, BACK, 30); 
	}
	else					
	{
		wheel(&pwm_motorBA, &pwm_motorBB, BACK, 5); 
		wheel(&pwm_motorAA, &pwm_motorAB, BACK, 40); 
		park_count3++;
	}
	if (park_count3 > 45)	
	{
		mode = 3;
	}
}
void park_mode2 ( uint32_t UT2_avg ) { if ( UT1_avg < 5 ) { wheel ( & pwm_motorBA , & pwm_motorBB , BACK , 70 ) ; wheel ( & pwm_motorAA , & pwm_motorAB , BACK , 30 ) ; } else { wheel ( & pwm_motorBA , & pwm_motorBB , BACK , 5 ) ; wheel ( & pwm_motorAA , & pwm_motorAB , BACK , 40 ) ; park_count3 ++ ; } if ( park_count3 > 45 ) { mode = 3 ; } }
Park mode 2 to turn back in the parking lot
Park mode 2 to turn back in the parking lot
// turn back right to locate right place
 // direction of two motor
 // direction of two motor
 // move backward within the found parking lot according to the park_mode 1
 // direction of two motor
 // direction of two motor
 // move to the park mode 3
