Go Down

Topic: Frequency Counter (Read 6 times) previous topic - next topic


What kind of Arduino are you using? The library seems to be defined for the Arduino with the 168 ship, not the 328.

And b.t.w. where is declared that pin 5 is an input?

The library is hard-coded to work with only that pin.


Yes: you are right: I'm using Arduino 328.
So, should I forget abpou that sketch ? :(
Can you suggest me a good Frq. Counter library/sketch for 328?

Thank you


Jan 14, 2010, 07:20 pm Last Edit: Jan 14, 2010, 07:26 pm by CalcProgrammer1 Reason: 1
I'm having the same problem, I got an Arduino with ATMega328, compiled the same software, fixed the capital V to make it compile, all that stuff and I have it connected straight to the PWM Timer1 output of another AVR (ATMega168 on my breadboard running a fan controller program I'm working on) and it isn't outputting any frequency.  Is there any reason that the program only works on the 168 and not the 328 (last I checked they're identical chips except one has more memory)?

EDIT:  Easy fix, whoever coded the frequency counter library threw in a check that only compiles the code if the target is an ATMega168, delete those two lines (the #if and #endif following it) in the FreqCounter.cpp file, save it, and then re-compile your Arduino code.  it works great!


Great CalcProgrammer1.
It works fine indeed !!! :D
You are a genius ! Next time I'll sweep an oil lamp I'll expect you to pop up  ;)


hello everybody
is there a way to measure TWO frequencies, one in each of two signals? Or, even better, two frequencies in the same signal? In other terms, can arduino perform some FFT?

Go Up