Printing to LCD.

I was wondering if it's possible to print what you type into a serial port on an LCD. I have it so it prints the byte it receives which I have no idea why it does that but it works so I'll post the code if you'd like to take a look and give me some pointers.

Do you mean a code like this? It’s in your Arduino software under examples. You can check out ladyada’s tutorial on LCDs if you are new to it. :wink:

 * Displays text sent over the serial port (e.g. from the Serial Monitor) on
 * an attached LCD.

#include <LiquidCrystal.h>

// LiquidCrystal display with:
// rs on pin 12
// rw on pin 11
// enable on pin 10
// d4, d5, d6, d7 on pins 5, 4, 3, 2
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

void setup()

void loop()
  // when characters arrive over the serial port...
  if (Serial.available()) {
    // wait a bit for the entire message to arrive
    // clear the screen
    // read all the available characters
    while (Serial.available() > 0) {
      // display each character to the LCD

Hmm, I'll test this code out now. Also, where are these tutorials?

Do you mean like the "LiquidCrystal - Serial Input" example at


Also, where are these tutorials?

I gave you one location in my previous post. There are also examples buried in your Arduino download. Mine are here: "C:\Arduino\arduino-0017\hardware\libraries\LiquidCrystal\examples"


This code you posted is not working for me. Maybe it’s my wiring again :confused:
Was not my wiring I just made a few edits though.

Perhaps you should follow up on your other (Hardware | Troubleshooting) thread, where you thought you fixed your display problem.


No, I fixed the code. It wasn't working right. The hardware problem was OK. :D

It looks as if the Hacktronics example and the code in reply #1 are written for an earlier version of LiquidCrystal than the one that comes with Arduino v0017.

If you are still having problems (I can't be sure from your posts) I suggest you take a look at the example sketches that come in the Arduino download.