i want run a loop 12 times but all i know is how to run a loop forever? I tried a few lines of code i found on a different forum but none of them worked.
sebioa:
i want run a loop 12 times but all i know is how to run a loop forever? I tried a few lines of code i found on a different forum but none of them worked.
Show your best attempt so we can see what goes wrong and advise accordingly.
Don't forget to use code tags ([code]your code here[/code]
) when posting your code.
for, do, loop, while, if
take your pick - C 101
If you're worried about it inside loop(), set a flag after you've done it and test that next time around, skipping over it if the flag is set.
if (numRepeats < 12) {
// do stuff
numRepeats ++;
}
...R