Issue #74 new
ItsJasonClark
created an issue

If there's an example for autoscroll, I can't find it. I tried the following (with some help from mklec's blog post for basic setup):

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C   lcd(0x27,2,1,0,4,5,6,7);

char output[] = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ\n";


void setup()
{
  lcd.begin (16,2);
  lcd.setBacklightPin(3, POSITIVE);
  lcd.setBacklight(HIGH);

  lcd.clear();
  lcd.autoscroll();
   lcd.setCursor ( 16, 1 ); // why 16, not 15?

}

int ndx = 0;
void loop()
{

   if (output[ndx] == '\n') {
     ndx = 0;
   }
   lcd.write(output[ndx++]);
  delay(250);

}

It starts out ok. The first character ("a") appears at the bottom right position, and as each new character appears, the message scrolls leftward. Even as it scrolls off the screen, all is fine... until it hits "y" (25th character). "y" appears in the correct column, but it appears on the top row, not the bottom. All of the existing characters on the bottom keep scrolling left, but all new characters appear on the top row. Once "E" appears (still on the top row), the pattern starts again on the bottom row (with lowercase "a"), and now I have characters scrolling by on both rows. Both rows scroll correctly until just after it wraps around, and then top and bottom rows swap places,

Here are a few "screenshots":

         yz12345
pqrstuvwx

567890ABCDEFGHIJ
          abcdef

XYZabyz123456789
tuvwxcdefghijklm

The board is a Nano clone, and the LCD is from Banggood.

Comments (0)

  1. Log in to comment