Count number of pulses per 500ms with mega2560

Hello,

I am trying to figure out how to count the number of pulses per second from a digital input. Having trouble wrapping my head around the timer function and its implementation on the mega board. Forgive the noob question. Any insight is greatly appreciated.

Bill

Any insight is greatly appreciated.

The code you posted doesn't even come close to doing what you want.

So i figured out how to read the pulses in. How do i change the state of 2 led's using data from both a digital pin and an analog pin simultaneouly?

How do i change the state of 2 led's using data from both a digital pin and an analog pin simultaneouly?

Which two LEDs and what digital pin and what analog pin? How is the data from the two input pins to be used to affect the two output pins?

If the digital pin is HIGH or LOW && the Analog pin is > than or < than or = to a set value make the LEDs go ON or OFF using port manipulation.

Show us the code you have now.

Billdefish:
Hello,

I am trying to figure out how to count the number of pulses per second from a digital input. Having trouble wrapping my head around the timer function and its implementation on the mega board. Forgive the noob question. Any insight is greatly appreciated.

Bill

What "timer function"?