hey guys, I'll try and make this short and sweet. using Arduino Uno R3 and nokia 6100 LCD Shield from sparkfun.
I have integer Y which for this example increases by 1 each loop while the program is running. each time it increases I need to write to the screen.
this does not work, returns an error while compiling.
"Cannot convert 'string' to 'char*' for arg '1' to 'void setStr(char*, int, int, int, int)'"
if I set the value in the setStr line then it works fine. e.g.
with Y it does not work, I have also tried putting Y in inverted commas e.g. \"Y\"
I've also tried converting it from an integer to a string which also didn't work.
any ideas? the setStr code is as follows.
most of it is just copy/paste out of examples.
I have integer Y which for this example increases by 1 each loop while the program is running. each time it increases I need to write to the screen.
Rich (BB code):
void loop()
{
Y += 1;
LCDClear(x);
setStr(Y, 0, 0, RED, x);
delay(1000)
}
"Cannot convert 'string' to 'char*' for arg '1' to 'void setStr(char*, int, int, int, int)'"
if I set the value in the setStr line then it works fine. e.g.
Rich (BB code):
setStr("Hello World", 0, 0, RED, x);
I've also tried converting it from an integer to a string which also didn't work.
any ideas? the setStr code is as follows.
Rich (BB code):
void setStr(char *pString, int x, int y, int fColor, int bColor)
{
x = x + 16;
y = y + 8;
// loop until null-terminator is seen
while (*pString != 0x00) {
// draw the character
setChar(*pString++, x, y, fColor, bColor);
// advance the y position
y = y + 8;
// bail out if y exceeds 131
if (y > 131) break;
}
}