#include <LiquidCrystal.h>
byte smiley[8] = {0b00000, 0b00000, 0b01010, 0b00000,
0b10001, 0b01110, 0b00000, 0b00000
};
// initialize the LCD library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
Serial.begin(9600);
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("Sprintf");
lcd.setCursor(0,1);
lcd.print("Test");
delay(1000);
lcd.clear();
}
void loop() {
char buffer[32];
//lcd.clear();
lcd.createChar(0, smiley);
lcd.setCursor(0,0);
sprintf(buffer, "Hello %s%c", "world", lcd.write(byte(0)));
lcd.print(buffer);
//lcd.write(byte(0));
lcd.setCursor(0,1);
lcd.print("world!");
}