Hi, I am a new teensy 3.2 owner and I am experimenting with the FreqMeasure library. I am seeing the library work for just a few seconds, and then it ceases to print out frequency data. It works for about 5 seconds, then it stops. If I swap the teensy out for an arduino uno, it works as expected.
I'm using the sample code provided.
The sketch continues to run, but FreqMeasure.available() ceases to evaluate to true after a few seconds, stopping the printout of the frequency information.
This post seems to report a similar issue.
https://forum.pjrc.com/threads/26173-FreqMeasure-freezing
Anybody else encountered this or have any troubleshooting tips?
Thanks!
I'm using the sample code provided.
Code:
#include <FreqMeasure.h>
void setup() {
Serial.begin(57600);
FreqMeasure.begin();
}
double sum=0;
int count=0;
void loop() {
if (FreqMeasure.available()) {
// average several reading together
sum = sum + FreqMeasure.read();
count = count + 1;
if (count > 30) {
float frequency = FreqMeasure.countToFrequency(sum / count);
Serial.println(frequency);
sum = 0;
count = 0;
}
}
}
The sketch continues to run, but FreqMeasure.available() ceases to evaluate to true after a few seconds, stopping the printout of the frequency information.
This post seems to report a similar issue.
https://forum.pjrc.com/threads/26173-FreqMeasure-freezing
Anybody else encountered this or have any troubleshooting tips?
Thanks!