Yes and also for an arduino. The issue is finding a way to not miss a pulse while I am calculating the speed, checking other sensors and displaying the info. I have no issues with the math derived from pulses per time period. The question is more about how to count the pulses and keep time. If I was doing this on an arduino, I would count pulses for .75 seconds, and think most of my math could be done in the .25 seconds... but that wastes time waiting on pulses and doesn't give me much for everything else.I would think so. At 100 MPH you should be getting 320 pulses per second, one every 3 milliseconds. That's pedestrian for an RP2.
The interrupt routines, at least as I have learned them, mess up the library that I use to display to the I2C LCD. And again the Pico can handle much more so I was thinking use one proc, or a PIO to keep count and or the current average and the other proc/main/only proc could handle all the other sensors and poll the variable where I keep the wind speed.I am not sure why using interrupts wouldn't work to keep count of the pulses but I'm not familiar with Arduino coding. Maybe there's an issue with how you have implemented your code ?
There is one more addition, gusts, but again I can handle that logic, just more that I am doing while trying not to miss a pulse.
So I guess the main question is more of, using an interrupt on a PGIO pin to a routine that just increments a counter, then use a timer routine to calculate the speed and store for averaging, or is using the PIO a good way to have the ticks be counted by an independent sub set of the Pico?
Bob
Statistics: Posted by parrst — Sat Aug 17, 2024 7:07 pm