The continue statement skips the rest of the current iteration of a loop (for, while, or do…while). It continues by checking the conditional expression of the loop, and proceeding with any subsequent iterations.
Example Code
The following code writes the value of 0 to 255 to the PWMpin, but skips the values in the range of 41 to 119.
for (int x = 0; x <= 255; x ++) {
if (x > 40 && x < 120) { // create jump in values
continue;
}
analogWrite(PWMpin, x);
delay(50);
}
See also
Title
Arduino Newsletter
We care about the privacy and personal data of our users.
To continue, please give us your consent:
Please confirm that you have read the privacy policy
Thank you for subscribing!
Curious to learn more?
Are you also a teacher, student, or professional that loves using Arduino in your day-to-day activities?
Then keep up-to-date with either our STEM or Professional monthly newsletters.
Arduino weekly newsletter (already subscribed)
Educators can benefit from the ever growing tech that shapes our environment through fun cool projects.
Why not awe your boss with highly innovative ways to help keep your enterprise connected at no extra cost?
Arduino Survey
We'd like to get to know you little better.
Please help us improve by answering this super short optional survey.