Continue

From Microduino Wiki
Revision as of 07:23, 4 August 2016 by Fengfeng (talk) (Created page with "*'''continue''' Continue statement can skip the rest iterative part( do, for or while )in the current loop. It can check the loop condition expression and continue any sub...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
  • continue

Continue statement can skip the rest iterative part( do, for or while )in the current loop. It can check the loop condition expression and continue any subsequent iterations.

  • Example

for (x = 0; x < 255; x ++)
{
    if (x > 40 && x < 120){      // when x is between 40 and 120, skip these two sentences, namely the iterations
        continue;
}
 
    digitalWrite(PWMpin, x);
    delay(50);
}

[Return to Arduino Syntax Manual]