Hello
I have Byvac BV4619 LCD with a 4x20 LCD. when i use the by byvac library it work fine and all is good. The problem is that I want to use a menu in my project and most will only support the standard LCD library.
Further to previous post I have used Menu.h and this works but is quite basic. I have nearly got menu back end to work by replacing all the serial print commands but i keeps failing to compile when it need to print a character string. (all normal print commands work and if I comment out this line it compiles ok)
The Byvac library has a print character function but doesn’t seem to work. I have no idea which library i need to change.
Any help would be great, even if it just pointing me in the right direct.
By vac details BV4619 - ByVac
it is the line disp.lcd_print(used.item.getName()); that fails in the menuUsed function below
void menuUsed(MenuUseEvent used){
disp.lcd_cls();
disp.lcd_rowcol(0,0);
disp.lcd_print("You used ");
disp.lcd_rowcol(0,1);
disp.lcd_print(used.item.getName());
delay(3000); //delay to allow message reading
disp.lcd_cls();
disp.lcd_rowcol(0,0);
disp.lcd_print("menu screen");
menu.toRoot(); //back to Main
Error message is
sketch_jan25a.ino: In function 'void menuUsed(MenuUseEvent)':
sketch_jan25a:135: error: call of overloaded 'lcd_print(const char*)' is ambiguous
sketch_jan25a.ino:135:37: note: candidates are:
In file included from sketch_jan25a.ino:28:0:
C:\Users\Ross\Documents\Arduino\libraries\bv4619_I/bv4619_I.h:38:14: note: void LCD::lcd_print(char*) <near match>
void lcd_print(char *value);
^
C:\Users\Ross\Documents\Arduino\libraries\bv4619_I/bv4619_I.h:38:14: note: no known conversion for argument 1 from 'const char*' to 'char*'
C:\Users\Ross\Documents\Arduino\libraries\bv4619_I/bv4619_I.h:39:14: note: void LCD::lcd_print(int) <near match>
void lcd_print(int value);
^
C:\Users\Ross\Documents\Arduino\libraries\bv4619_I/bv4619_I.h:39:14: note: no known conversion for argument 1 from 'const char*' to 'int'
call of overloaded 'lcd_print(const char*)' is ambiguous
This the section from the BV4619 Cpp
// Print overloaded
// *****************************************************************************
// String
void LCD::lcd_print(char *value)
{
Wire.beginTransmission(_i2adr);
Wire.write(3); // data
while(*value) Wire.write(*(value++));
Wire.write(13); // always finish with 13
Wire.endTransmission();
delay(1);
}
// Int
void LCD::lcd_print(int value)
{
char buf[15];
sprintf(buf, "%d", value);
lcd_print(buf);
}
And the from the h file
class LCD : public TwoWire
{
public:
// non-device specific
LCD(char address);
void lcd_cls();
void lcd_rowcol(char row, char col);
void lcd_cursor(char cv);
void lcd_print(char *value);
void lcd_print(int value);
void lcd_bl(char red, char green, char blue);
void lcd_defcust(char position, char *definition);
void lcd_printcust(char address);
int lcd_getkey();
int lcd_keybuf();
void lcd_keyclear();
private:
char _i2adr;
int i2_16bit();
};