Grove LCD v1.1 Print String

Hello,

I have the Grove LCD v1.1 with the latest files from the wiki. And for some reason, I can’t get Arduino IDE 1.0.3 to compile when sending a string to the Grove LCD. I can use INT variables fine and slcd(“Type Whatever Here”) fine. Thanks in advance for any help!


#include <SerialLCD.h>
#include <SoftwareSerial.h>

SerialLCD slcd(11,12);

void setup() {
  slcd.begin();
}

void loop() {
  slcd.setCursor(0, 1);

String test3;
test3 = "blah";
  slcd.print(test3);

}

hi,memphis2k
You can not compile successful when sending a string to the Grove LCD is because our serialLCD Library do not support to send strings.
You can see the print function when open the SerialLCD.CPP file. AS show below:

[code]
// Print Commands

void SerialLCD::print(uint8_t b)
{
SoftwareSerial::write(SLCD_CHAR_HEADER);
SoftwareSerial::write(b);
}
void SerialLCD::print(const char b[])
{
SoftwareSerial::write(SLCD_CHAR_HEADER);
SoftwareSerial::write(b);
}[/code]
so you can send unsigned int data or char type data to print function.For example:

[code]#include <SerialLCD.h>
#include <SoftwareSerial.h>

SerialLCD slcd(11,12);

void setup() {
slcd.begin();
}

void loop() {
slcd.setCursor(0, 1);

unsigned int test3;
test3 = 123;
slcd.print(test3);
}[/code]
The above code can compile successfully. I hope to help you.