oid setup() {
Serial.begin(9600);
}
void CarBack(uint16_t velocity)
void Back_line(uint16_t velocity, uint8_t line, uint16_t reduc
tion_ratio, uint8_t *alig_dir, uint8_t mode)
{
uint16_t temp_velocity = 0;
CarBack(velocity);
if (mode==1)
{
while ((Line_cnt < line) || (*alig_dir !=5))
{
if (Line_cnt < (line - 1) || (line == 1))
temp_velocity += (velocity / 10);
else if (temp_velocity >= 50)
temp_velocity -= (velocity / reduction_ratio);
Car_velocity = velocity;
track();
delay(5);
}
}
else if(mode==0)
{
while ((*alig_dir != 2)&&(*alig_dir != 4))
{
track();
delay(5);
}
}
else if(mode==2)
{
while (*alig_dir !=7)
{
track();
delay(5);
}
}
CarStop();
delay(400);
}
}