Go Down

Topic: LCD and Virtual wire (Read 729 times) previous topic - next topic

PaulS

Quote
The idea here:
        msg = *buf;
        lcd.print(msg);

That may be the idea, but it isn't reality. There is no way to store "End" in a character variable. You need an array to store more than one character. Which buf is. So, why not just use buf?

DrMau

Because buf is of the type uint8_t * and when I use  lcd.print(but); I get an error saying that I can use this type as an argument for lcd.print.


PaulS

Quote
Because buf is of the type uint8_t * and when I use  lcd.print(but); I get an error saying that I can use this type as an argument for lcd.print.

So, lie to the lcd.print() method.

Code: [Select]
lcd.print((char *)buf);

DrMau

I've tried that before too. And in fact. It does print the whole word "End". However it also printed some "strange" characters that I can't get rid of it. Even if I use something like lcd.clear or lcd.print("              "); the characters remain there. That was the reason why I was also printing to the Serial. And when I looked at the serial output, some strange characters were also being printed.

PaulS

Quote
However it also printed some "strange" characters that I can't get rid of it.

You could, it buf was actually a string. You can make it more like a string:
Code: [Select]
buf[buflen] = '\0';
after the receive call.

Go Up