I am trying to get a frequency reading off pin 5 of an Arduino Uno r3 using FreqPeriodCounter.h. The code as stands will not compile. Can someone look at it and tell me what I am doing wrong?
This is the error message Arduino generates.
sketch_aug26a:7: error: no matching function for call to 'FreqPeriodCounter::FreqPeriodCounter(int, long unsigned int (&)())'
C:\Documents and Settings\Mark Tiede\My Documents\Arduino\libraries\FreqPeriodCounter/FreqPeriodCounter.h:20: note: candidates are: FreqPeriodCounter::FreqPeriodCounter(byte, long unsigned int (*)(), unsigned int)
C:\Documents and Settings\Mark Tiede\My Documents\Arduino\libraries\FreqPeriodCounter/FreqPeriodCounter.h:18: note: FreqPeriodCounter::FreqPeriodCounter(const FreqPeriodCounter&)
sketch_aug26a:26: error: expected unqualified-id before '{' token
#include <LiquidCrystal.h>
#include <FreqPeriodCounter.h>
LiquidCrystal lcd(11, 10, A5, 4, 3, 2);
const byte freqPin = 5;
FreqPeriodCounter counter(freqPin, millis);
// setup the pins to be used
void setup()
{
lcd.begin(16,2);
lcd.noCursor();
lcd.clear();
}
//////MAIN LOOP\\\\\\\
void loop()
{
tempolcd();
}
///////functions\\\\\\\\\
void tempolcd()
{
counter.poll();
float freq = (float)1 / counter.period;
lcd.setCursor(0,1); // Set cursor to column 1, row 2.
lcd.print("TEMPO "); // Printing TEMPO to the LCD screen.
lcd.setCursor(6,1); // Set cursor to column 7, row 2.
lcd.print(freq); // Display TEMPO time to LCD screen.
}
Thanks,
Bruce