Hello. I'm trying to run the example program given on the FreqMeasure Librarys page
I've got a 0-2.6Vpp 600Hz square wave coming out of a Wavetek connected to pin 22 on the Teensy and ... nothing! I dont even get a incorrect signal.
It seems FreqMeasure.available is never true despite seeing the signal on my scope from the Teensy pin directly - i also tried it with a brand new Teensy 4.0 to be sure.
Im running Linux and ive got a whole slew of other Teensy stuff working just dandy, but this simply wont do it for some reason. Any ideas of what could be going on here?? It smells of me having done something fundamentally wrong..
Thanks
Karl
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;
}
}
}
I've got a 0-2.6Vpp 600Hz square wave coming out of a Wavetek connected to pin 22 on the Teensy and ... nothing! I dont even get a incorrect signal.
It seems FreqMeasure.available is never true despite seeing the signal on my scope from the Teensy pin directly - i also tried it with a brand new Teensy 4.0 to be sure.
Im running Linux and ive got a whole slew of other Teensy stuff working just dandy, but this simply wont do it for some reason. Any ideas of what could be going on here?? It smells of me having done something fundamentally wrong..
Thanks
Karl