while((s1==HIGH)&&(s2==HIGH)&&(s3==HIGH))
{
if(a==5)
{
stop();
delay(2000);
}
// time1=millis();
//Serial.println(time1 );
if(a==7)
{
stop();
delay(2000);
}
if(a==9)
{
stop();
delay(2000);
}if(a==13)
{
stop();
delay(2000);
}if(a==17)
{
stop();
delay(2000);
}
go();
delay(500);
line();
}
}
Once you get into that while loop, you have no way of getting out, no matter what the sensors detect, because you never read them again. Surely, THAT can't be what you want.