I have tried to do my own homework before posting, but can't find anything simple enough for me to follow.
Is there an easy way to read a PWM signal (0-5vdc) and integrate the total on-time? What I would like to do is make a gauge readout showing how fast fuel is being consumed by an engine. I have the output display under control, and I think I can manage the conversion once I get the input coded, but I need some help figuring out how best to get my data.
Is Pulsein the method I want to use? Or is there a better way? I am only concerned with steady-state data, so I don't need latency to be super low. I could sample intervals, say twice per second, average the data over the interval, then update the display and that would be plenty. The frequency will vary of course, but really what I need for data is the "area under the curve" over time.
If I can easily get a frequency reading from the same pin that's giving me the on-time data, then great- but it's not really a priority.
Appreciate any advice on this