Hi there, my problem is, i want to create an RPM meter for my motocycle. I have build DPS thats generates logic 1 on every engine turn. I have 2 options of measuring the rpm. First is to measure number of pulses in specified time, lets say one second, the math then would be "rpm=pulseCount*60000".Second i can measure the time between two pulses, so the math is "rpm=60000/timeBetweenPulses". But i cannot think of a way to either measure time between pulses or how to count number of pulses in specified time.Any ideas?Im using Mega2560 board.
Can we assume you've been through all 109 000 results Google lists, and found nothing?
well i could not find anything making sense to me
digitos:
i cannot think of a way to either measure time between pulses or how to count number of pulses in specified time.
I'm struggling to understand the problem. You've obviously grasped the two approaches available to you, and either of them could work. The 'time between pulses' approach would work better for low frequency signals and the 'number of pulses in a specified time' approach would work better for higher frequency signals I think the latter would probably more more suitable here.
If you're having trouble translating these concepts into code then I suggest you start by running the blink without delay example sketch and then study it until you understand it thoroughly. If you think about it, you'll see that it's doing something very similar to what you need to solve this problem.