"Steemit Phillippines" Scrolling Text on LCD Display

in steemph •  7 years ago  (edited)

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.


20180417_152610.jpg

#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);    
}

20180417_161735[1].gif


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);
}

20180417_151701_HDR.jpg


I want to say Thank you to sir Terry @surpassinggoogle for supporting our blogs, and to my friends here @awesomenyl and @fycee 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.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Congratulations @pakganern! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of comments

Click on any badge to view your own Board of Honor on SteemitBoard.

To support your work, I also upvoted your post!
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Upvote this notification to help all Steemit users. Learn why here!