Calibrating Nawrath's "FreqCounter.h"
greetings,
i using nawrath's "freqcounter.h" using following demo code:
which example.
when put 280 hz in reading of 28.
when put 28,000 hz in reading of 2,800.
how should correct factor of 10 error?
thanks and...
kindest regards,
paul flint
i using nawrath's "freqcounter.h" using following demo code:
code: [select]
// frequency counter lib example
/*
martin nawrath khm lab3
kunsthochschule f¸r medien kˆln
academy of media arts
http://www.khm.de
http://interface.khm.de/index.php/labor/experimente/
*/
#include <freqcounter.h>
unsigned long frq;
int cnt;
int pinled=13;
void setup() {
pinmode(pinled, output);
serial.begin(115200); // connect serial port
serial.println("frequency counter");
}
void loop() {
// wait if serial going on
freqcounter::f_comp=10; // cal value / calibrate professional freq counter
freqcounter::start(100); // 100 ms gate time
while (freqcounter::f_ready == 0)
frq=freqcounter::f_freq;
serial.print(cnt++);
serial.print(" freq: ");
serial.println(frq);
delay(100); //original delay delay(20);
digitalwrite(pinled,!digitalread(pinled)); // blink led
}
which example.
when put 280 hz in reading of 28.
when put 28,000 hz in reading of 2,800.
how should correct factor of 10 error?
thanks and...
kindest regards,
paul flint
multiply 10?
maybe has line - freqcounter::f_comp=10;
maybe has line - freqcounter::f_comp=10;
Arduino Forum > Using Arduino > Programming Questions > Calibrating Nawrath's "FreqCounter.h"
arduino
Comments
Post a Comment