Go Down

Topic: 1602 Display trouble? (Read 2461 times) previous topic - next topic

floresta

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

funkyguy4000

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?
Accelerate to 88 miles per hour.

floresta

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

Go Up