Go Down

Topic: LCD 16x1 to Arduino UNO (Read 298 times) previous topic - next topic

bigzed

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: [Select]

#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

luisilva

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?

floresta

#2
Aug 28, 2014, 04:19 am Last Edit: Aug 28, 2014, 04:26 am by floresta Reason: 1
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

groundfungus

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

shrims4u

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.

floresta


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

floresta


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


cattledog

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.

floresta

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

Go Up