it ran, but it the loop is happens endlessly ,,
what can i do to have the whole process under the loop function to happen for only one time???
If you want something to happen once, the usual advice is to do it in setup(), instead. It seems stupid to try to force loop() to do something once.
Of course, that is possible.
bool doneIt = false;
void loop()
{
if(!doneIt)
{
doIt();
doneIt = true;
}
}