Hello Dear Steemians, In this post of the i2c LCD i will provides two additional functions of scroll text From Right line and scroll in from Left (line to display text on, string to be scrolled). I will use STEEMIT PHILIPPINES our guild, to display on the LCD below.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup()
{
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.backlight();
lcd.setCursor(0,0);
lcd.print(" STEEMPH ");
}
void loop()
{
lcd.setCursor(16,1);
lcd.autoscroll(); // Set diplay to scroll automatically
lcd.print(" "); // set characters
delay(700);
}
Here is the code that i made
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
const byte lcdAddr = 0x27; // Address of I2C backpack
const byte lcdCols = 16; // Number of character in a row
const byte lcdRows = 2; // Number of lines
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
// Demo parameters
const char demoText[]= " STEEMIT PHILIPPINES ";
const unsigned int scrollDelay = 500; // Miliseconds before scrolling next char
const unsigned int demoDelay = 2000; // Miliseconds between demo loops
byte textLen; // Number of visible characters in the text
void setup() {
textLen = sizeof(demoText) - 1;
lcd.begin(16, 2);
lcd.backlight();
lcd.print(demoText);
delay(demoDelay);
}
void loop() {
// Scroll entire text in a row to the left outside the screen
for (byte positionCounter = 0; positionCounter < textLen; positionCounter++) {
lcd.scrollDisplayLeft();
delay(scrollDelay);
}
// Scroll hidden text through entire row to the right outside the screen
for (byte positionCounter = 0; positionCounter < textLen + lcdCols; positionCounter++) {
lcd.scrollDisplayRight();
delay(scrollDelay);
}
// Scroll text to the right back to original position
for (byte positionCounter = 0; positionCounter < lcdCols; positionCounter++) {
lcd.scrollDisplayLeft();
delay(scrollDelay);
}
delay(demoDelay);
}
I want to say Thank you to sir Terry for supporting our blogs, and to my friends here
and
thank you for pushing me to keep posting beacause felt so unappreciated this past few weeks, almost 1 month coz its hard to make a long exeptional post and do programming at the same time, for a 0 reward that i get. :( , but now im starting to post again, not too big reward atleast appreciated. thank you guys for stopping by.