FreqMeasure lib issues

Status
Not open for further replies.

DemolishunWork

Active member
I am trying to use the FreqMeasure library here: https://www.pjrc.com/teensy/td_libs_FreqMeasure.html

I added the FreqMeasure library (unzipped) into the libraries directory under the main Arduino directory where all the sketches are stored.

Then I added the header file to my sketch and I get this error:
error: #error "Unknown chip, please edit me with timer+counter definitions"

My IDE is set for Teensy 3.1 and inside the FreqMeasureCapture.h file is a definition for __MK20DX256__.

Here is some test code to show this in action:
Code:
#include <FreqMeasure.h>

void setup() {
  // put your setup code here, to run once:
}
void loop() {
  // put your main code here, to run repeatedly:   
}

I tried adding #include <Arduino.h> before the FreqMeasure include, but that did not change anything. For some reason it is not seeing __MK20DX256__ defined when it should be.
 
I added the FreqMeasure library (unzipped) into the libraries directory under the main Arduino directory where all the sketches are stored.

No, that's not where it goes.

The simplest way to get this installed is with the 1.20-rc2 installer, which has the latest FreqMeasure. Just select it on the page about installing extra libraries, and the installer will copy it to the proper location.
 
Hey Paul,

I have FreqMeasure working now and it uses pin 3. I also have tone running on pin 5. I understand these are separate PWM hardware counters for those pins. Are there any interactions I should worry about? I noticed FreqMeasure talks about analogWrite (PWM) and I assume that is because someone could select a pin on the counter as FreqMeasure?
 
They're separate timers, so no conflict.

Also, if you're using the tone() function, it doesn't use the PWM timer at all. It uses an IntervalTimer and code in an interrupt, because tone() needs to support all digital pins, not merely the ones with PWM.
 
Status
Not open for further replies.
Back
Top