Pages: [1]   Go Down
Author Topic: PROBLEM : Interfacing SERIAL MONITOR with 16X2LCD  (Read 265 times)
0 Members and 1 Guest are viewing this topic.
Coimbatore, Tamil Nadu, India.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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????????????

« Last Edit: November 07, 2013, 12:50:09 am by TM_Soundhararajan » Logged

NSW Australia
Offline Offline
Faraday Member
**
Karma: 78
Posts: 3159
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 32
Posts: 4245
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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
Logged

Pages: [1]   Go Up
Jump to: