Skip to content
This repository has been archived by the owner on Oct 22, 2020. It is now read-only.

Display long text #8

Open
a-phe-lei-a opened this issue Jan 20, 2017 · 0 comments
Open

Display long text #8

a-phe-lei-a opened this issue Jan 20, 2017 · 0 comments

Comments

@a-phe-lei-a
Copy link

a-phe-lei-a commented Jan 20, 2017

Hello,
I use you library but I don't have the possibility to show a long text. If my text is up to 40 charter this is cutting on two part and the 41 charter and after is showing on the second line.

This is my code :

#include <LiquidCrystal_I2C.h>
#include <Keypad_I2C.h>


const byte keypadRow = 4;
const byte keypadCol = 4;

byte rowPins[keypadRow] = {0,1,2,3}; // Row 0,1,2,3
byte colPins[keypadCol] = {4,5,6,7}; // Col 0,1,2,3

int keypadArdesse = 0x22; // A0 and A2 GND and A1 5V

char keys[keypadRow][keypadCol] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

const byte lcdRow = 2;
const byte lcdCols = 16;

int lcdAdresse = 0x27;    // Default adress

Keypad_I2C keypad = Keypad_I2C(makeKeymap(keys), rowPins, colPins, keypadRow, keypadCol, keypadArdesse);
LiquidCrystal_I2C lcd = LiquidCrystal_I2C(lcdAdresse,lcdCols,lcdRow);

bool backlight = true;

char txtFirstLine[] = "An den exis ti na kanis ela na pame mia megali volta opou 8elis ";

void setup(){
  Serial.begin(9600);
  keypad.begin();
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.printstr(txtFirstLine);
}

void loop(){
  char key = keypad.getKey();
  if(key){
    Serial.println(key);
    if(key == 'A')
      lcd.scrollDisplayLeft();
    if(key == 'B')
      lcd.scrollDisplayRight();
  }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant