Pages: [1]   Go Down
Author Topic: LCD 16x1 to Arduino UNO  (Read 249 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Guys,

I just finished connecting my 16x1 Display http://www.conrad.de/ce/de/product/184071/LC-Display-Schwarz-Gelb-Gruen-B-x-H-x-T-80-x-36-x-135-mm-6H-LED-EV?ref=list to my Arduino Uno.

Since it is addressed as a 8x2 display I just this for initially testing it, but I only get 8 characters written and only if I address it as 16x1 or 8x1.
Any ideas what this is causing?

Code:
#include <LiquidCrystal.h>

LiquidCrystal lcd(5,6,7,8,9,10);

void setup {
    // set up the LCD's number of columns and rows:
    lcd.begin(8,2);     //is 16x1, adressed as 8x2
    lcd.setCursor(0,0);  //init right hand side
    lcd.clear();
    // Print a message to the LCD.
    lcd.print("hello wo");  //print left side
    lcd.setCursor(0,1);     //go to right
    lcd.print("rld!");      //print right side
}

void loop() {
}

Or is it doubtlessly a connecting problem?

best,
bigzed
Logged

Portugal
Offline Offline
Edison Member
*
Karma: 45
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If it behaves like other displays, if you do the connections wrong you don't get anything, only a "black bar".
Can you explain better what is wrong?
Logged

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

If your 16x1 display has only a single controller chip (or blob) then it should be configured as an 8x2. and your code should work.  You really don't need the lcd.setCursor(0,0) or the lcd.clear() since the lcd.begin() does an lcd.clear() and the lcd.clear() also sets the cursor to 0,0.  

If your 16x1 display has two controller chips (or blobs) , which is rare, then it should be configured as a 16x1 and you display everything with one lcd.print() statement.

A complete description can be found by following the LCD Addressing link at http://web.alfredstate.edu/weimandn.


Don
« Last Edit: August 27, 2014, 09:26:36 pm by floresta » Logged

BCC AZ USA
Offline Offline
Edison Member
*
Karma: 38
Posts: 1335
It gets hot so it must be working
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just dealt with this same problem.  I ended up using the liquid crystal library.  In setup use LCD.begin(16,2);.  Then when you want to write to the right 8 character's, use LCD.set cursor(0,1) then LCD.print() (or LCD.write).
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The problem of the text displaying like autoscroll in void loop() occurs only if I also put on the code for SPI which uses the same pin i.e. pin12.
However if I use the LCD screen alone it is working fine.
Logged

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

The problem of the text displaying like autoscroll in void loop() occurs only if I also put on the code for SPI which uses the same pin i.e. pin12.
However if I use the LCD screen alone it is working fine.

I think this belongs in another thread --> http://forum.arduino.cc/index.php?topic=263438.0

Don
Logged

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

I just dealt with this same problem.  I ended up using the liquid crystal library.  In setup use LCD.begin(16,2);.  Then when you want to write to the right 8 character's, use LCD.set cursor(0,1) then LCD.print() (or LCD.write).
Isn't that essentially what he is already doing in his original program?

The library really doesn't do much with the first parameter in lcd.begin(x,x) - it is the second parameter that you must match with the number of lines of controller memory that you are using.  This would 1 for the few true 16x1s that exist and 2 for all the others.


Don

Logged

Offline Offline
Full Member
***
Karma: 12
Posts: 203
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
but I only get 8 characters written and only if I address it as 16x1

If the OP had a true 16x1 display then I think he should have gotten more than 8 characters with his test of lcd.begin(16,1).

I'd recommend checking all the connections and solder joints. Perhaps you can post a picture of the soldering on the header and the other connections.
Logged

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

According to the datasheet, available through the 'Downloads' tab on the link in the first post, it is set up as an 8x2.  This means that his original program uses the correct addressing technique.  I suggest that he try that program again without the two extraneous steps.

If his connections were incorrect then he shouldn't have seen any characters. 


Don
Logged

Pages: [1]   Go Up
Jump to: