user63844: I currently have a function that poles all my sensors every time through it's loop, but I want to pole one of the sensors only every 10th time.  Currently there is a 10 millisecond delay at the beginning of my function.  I know I could increment a counter and use modulo, but is there a better practice for this?  

user14490: for(int i=0; i < 9999; ++i)
{
    if(i % 10 == 0)
    {
         //my actions on i = 0, 10, 20, 30 ...
    }
}


user16780: Normally it's suboptimal to reduce the speed of loop just to be able to count them.
Apply the BlinkWithoutDelay principle instead (which is not about Blink, but about WithoutDelay)

63844: <p>I currently have a function that poles all my sensors every time through it's loop, but I want to pole one of the sensors only every 10th time.  Currently there is a 10 millisecond delay at the beginning of my function.  I know I could increment a counter and use modulo, but is there a better practice for this?  </p>
 14490: <pre><code>for(int i=0; i &lt; 9999; ++i)
{
    if(i % 10 == 0)
    {
         //my actions on i = 0, 10, 20, 30 ...
    }
}
</code></pre>
 16780: <p>Normally it's suboptimal to reduce the speed of loop just to be able to count them.
Apply the BlinkWithoutDelay principle instead (which is not about Blink, but about <strong>WithoutDelay</strong>)</p>
