Hi,
I'm able to display text on the Nokia 5110 Module, but not values.
For instance
LcdString("123") displays 123
But
int a=123;
LcdString(a);
returns the following error when compiling:
v3_with_LCD:308: error: invalid conversion from 'int' to 'char*'
v3_with_LCD:308: error: initializing argument 1 of 'void LcdString(char*)'
This is LCD String:
void LcdString(char *characters)
{
while (*characters)
{
LcdCharacter(*characters++);
}
}
and this is LcdCharater:
void LcdCharacter(char character)
{
LcdWrite(LCD_D, 0x00);//Blank vertical line padding
for (int index = 0; index < 5; index++)
{
LcdWrite(LCD_D, ASCII[character - 0x20][index]);//0x20 is the ASCII character for Space (' '). The font table starts with this character
}
LcdWrite(LCD_D, 0x00);
}
So I tried to convert the integer into a string - with no success:
int a=123;
String astring=String(a);
LcdString(astring);
Error message:
v3_with_LCD.cpp: In function 'void setup()':
v3_with_LCD:310: error: cannot convert 'String' to 'char*' for argument '1' to 'void LcdString(char*)'
Any help most welcome!