Hi
I am working on an alarm clock project using an I2C LCD and a RTC. I am trying to interface the menu by modifying the code from here.This uses a library called LCDKeypad which is here. However I plan to use this code without the keypad but separate buttons and use an I2C LCD. But I don't know how I can change the code for the Keypad library to use I2C. I have tried changing the 'LCDKeypad.cpp' file to
/*
LCDKeypad.cpp
*/
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
// include this library's description file
#include <LiquidCrystal.h>
#include "LCDKeypad.h"
#include <Wire.h>
LCDKeypad::LCDKeypad() : LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
{
}
int LCDKeypad::button()
{
static int NUM_KEYS=5;
static int adc_key_val[5] ={
30, 150, 360, 535, 760 };
int k, input;
input=analogRead(0);
for (k = 0; k < NUM_KEYS; k++)
{
if (input < adc_key_val[k])
{
return k;
}
}
if (k >= NUM_KEYS)
k = -1; // No valid key pressed
return k;
}
However I get the error
'class LCDKeypad' has no member named 'begin'
I can't seem to understand why this is?
Sorry for this long and confusing question however if you know where I am going wrong, any help would be greatly appreciated.
Thanks ;D