Link to home
Start Free TrialLog in
Avatar of SeanKeys
SeanKeys

asked on

Events triggered on a counter

I have a small ISR with an if statement.  I have a 360 slot trigger wheel and what im trying to do is create an if statement that will only equate true on every 8th tooth.  The idea is to make it into a 45 tooth wheel, buy only executing on every 8th.  My problem is that I'm not sure how the statement should look.

something like this maybe..........
 
if(counter % 8)
{
do some stuff
}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of sunnycoder
sunnycoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SeanKeys
SeanKeys

ASKER

couldn't I also do

if (!(counter % 8))



?
Yes ... that would work too