Pages: 1 [2]   Go Down
Author Topic: 1602 Display trouble?  (Read 1737 times)
0 Members and 1 Guest are viewing this topic.
Western New York, USA
Offline Offline
Faraday Member
**
Karma: 26
Posts: 4118
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I only have 4 data lines connected now, how would I use the other 4?
You have a choice of using either 4 data bits or 8 data bits.  The operation of the display is the same in either case.  The programming for the 4-bit mode is more complex but that was done by those who wrote the library.  There is no practical reason for you to want or need to use the 8-bit mode.

Don
Logged

Wisconsin
Offline Offline
Edison Member
*
Karma: 4
Posts: 1000
I LOVE THIS STUFF!!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So I canuse all of the characters in the display just using 4 bit mode. Is there any example code or projects that demonstrate that?
Logged

Accelerate to 88 miles per hour.

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

Quote
So I canuse all of the characters in the display just using 4 bit mode.
"You have a choice of using either 4 data bits or 8 data bits.  The operation of the display is the same in either case."

Quote
Is there any example code or projects that demonstrate that?
I don't think that you have done your homework.

This code will display 80 characters on a 20x4 or 40x2 display.  You can use it unmodified on your 16x2 display but only 32 of the characters will be visible unless you 'shift' the display. 

Use this code as a starting point, increase the delay and reposition the cursor to (0,0) each time around and you should see all 80 characters, one after another, on your display.

Code:
#include <LiquidCrystal.h>

//LiquidCrystal lcd(rs,en,d4,d5,d6,d7);
  LiquidCrystal lcd(12, 11, 5, 4, 3, 2);       // put your pin numbers here

void setup()
  {
    lcd.begin(20, 4);                          // put your LCD parameters here
    for (char i=47; i<127; i++)                // send 80 consecutive displayable characters to the LCD
      {
        lcd.print(i);
        delay(100);                            // this delay allows you to observe the addressing sequence
      }
  }


void loop()
  { 
  }

Don
Logged

Pages: 1 [2]   Go Up
Jump to: