Hi everybody.
So, I am currently writing some code to measure the frequency of a square wave, and to print it to and LCD screen using an Orangutan SV-328 board. I have the Orangutan configured to work with Arduino IDE. However, I am getting an error in the code and I need some help. This is my first time coding in Arduino IDE but I do have some previous coding with Microsoft Visual Basic.
Here is the code in question:
#include <FreqMeasure.h>
#include <OrangutanLCD.h>
#include <OrangutanAnalog.h>
OrangutanLCD lcd;
OrangutanAnalog analog;
void setup() {
analog.setMode(MODE_8_BIT); // 5V has a bit value of 256 (2^8 = 256)
Serial.begin(57600);
lcd.print("Freq:");
FreqMeasure.begin();
}
double sum = 0;
int count = 0;
void loop() {
int input = analog.read(5);
if (FreqMeasure.available()) {
sum = sum + FreqMeasure.read();
count = count + 1;
if (count > 30) {
float frequency = FreqMeasure.countToFrequency(sum / count);
lcd.print(frequency);
lcd.print(" ");
sum = 0;
count = 0;
}
}
}
The line that is giving the error is the lcd.print(frequency)
Here are the errors:
call of overloaded'print(float&)' is ambiguous
note: candidates are: static void OrangutanLCD::print(char)
static void OrangutanLCD::print(unsigned char)
static void OrangutanLCD::print(long unsigned int)
static void OrangutanLCD::print(long int)
static void OrangutanLCD::print(unsigned int)
static void OrangutanLCD::print(int)
It may have something to do with the <OrangutanLCD.h> header file but I am not sure what changes I need to make to it.
Any help would be greatly appreciated. Thanks.