Hi there!
I'm doing a project and I got stuck, cause I'm reading a analog lecture with the analogRead() function, and depends of that lecture, I
got a servo attached to a PWM pin that move by the lecture, the deal is that, I just one that the servo move for one time, and as the lecture is continuously displaying the analogRead() my servo move as the same time that the lecture display, How can I tell it, that it has to move just one time? Is there any way to stop the void loop() ?
You can set a "flag', let the servo move one time if the flag is 0, and if the flag is 1 then don't let the servo move.
if (servoMoveFlag == 0){
// move the servo
(servo move code goes here)
// set the flag for next pass thru loop. don't move again unless something clears the flag
servoMoveFlag = 1;
}