PROBLEM : Interfacing SERIAL MONITOR with 16X2LCD

this is my code:
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup(){
lcd.begin(16, 2);
Serial.begin(9600);
}

void loop()
{

if (Serial.available()) {

delay(100);

lcd.clear();

while (Serial.available() > 0) {

lcd.write(Serial.read());
}
}
}

If I type string length of 16 or less than 16 in the serial monitor, the value are displayed in the "first row" of 16x2 lcd.

But if the string length goes beyond 16, only the first 16 character are displayed in the LCD of first row and remaining characters are getting displayed.

And my question is how to make display 17,18,19th character in the secondrow, if i give more than 16 characters in the serial monitor????????????

Please go back to your posting, select "modify" on your message, highlight the code section and click on the "#" icon above the edit window to mark it up as code.

Makes it much easier to read - and to reply to your query.


You of course assume that the first and second lines are in continuity.

It ain't necessarily so.

You need to set the cursor on the second line to print on that.

But - so far so good.

You of course assume that the first and second lines are in continuity.
It ain't necessarily so.
You need to set the cursor on the second line to print on that.

Follow the LCD Addressing link at http://web.alfredstate.edu/weimandn for the full explanation.

Don