I am attempting to print to a 1602 LCD screen with a PCF8574 I2C interface using the Bonezegei_LCD1602_I2C.h library. The project is a counter for a tipping bucket rain gauge. My setup works fine - the counter displays in the serial monitor, and the LCD screen works. The problem comes in when trying to display the number of tips (the count). The lcd.print statement works for a literal string (in quotes), but does not work for a string variable. My sketch:
//#include "Arduino.h"
#include <Bonezegei_LCD1602_I2C.h>
const int bucketPin = 2; // the pin that the tipping bucket is on
int bucketTipsCounter = 0; // counter for the number of tips
int bucketState = 1;
int lastBucketState = 0;
float inchesRain;
Bonezegei_LCD1602_I2C lcd(0x27);
void setup() {
lcd.begin();
lcd.setBacklight(0);
lcd.setPosition(0, 0); //param1 = X param2 = Y
delay(2000);
//lcd.setPosition(0, 0);
lcd.print("Display ON");
pinMode(bucketPin, INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
// read the bucket tip input pin:
bucketState = digitalRead(bucketPin);
if (bucketState != lastBucketState) {
// if the state has changed, increment the counter
if (bucketState == LOW) {
bucketTipsCounter++;
String strTips = String(bucketTipsCounter);
inchesRain = bucketTipsCounter*0.0126;
Serial.print("tip count ");
Serial.println(bucketTipsCounter);
Serial.print("strTips = ");
Serial.println(strTips);
Serial.print("inchesRain = ");
Serial.println(inchesRain);
//lcd.setPosition(0, 0);
//lcd.print("tip count ");
//lcd.print(tips);
lcd.setPosition(0, 1);
lcd.print("strTips =");
lcd.print(strTips);
}
// Delay a little bit to avoid bouncing
delay(50);
}
// save the current state as the last state, for next time through the loop
lastBucketState = bucketState;
}
I get the following error message upon compilation:
Compilation error: no matching function for call to 'Bonezegei_LCD1602_I2C::print(String&)'
I suppose it's something simple, but it has me stumped. There's very little documentation of this library's functions.