Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
xristos_xatz
Published © GPL3+

Scrolling Messages on LCD Screen

Scrolling messages using LCD screen and Arduino Uno.

BeginnerFull instructions provided5,884
Scrolling Messages on LCD Screen

Things used in this project

Story

Read more

Schematics

circuit_kb0nv8rtxs.fzz

Code

Code file

C/C++
#include <LiquidCrystal_I2C.h>

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


void setup() {
  lcd.begin(16,2);
}

void loop() {
  count_countdown();
  delay(600);
  scroll_left();
  delay(600);
  scroll_right();
}

//Displays the numbers from 0 to 9
void count_countdown(){
 lcd.setCursor(0,0);      
   for (int thisChar = 0; thisChar < 10; thisChar++) {
      lcd.print(thisChar);
      delay(500);
  }
  //Changes line and displays the numbers from 9 to 0
  lcd.setCursor(0,1);
    for (int thisChar =9; thisChar>=0; thisChar--) {
      lcd.print(thisChar);
       delay(500);
  }
  }

//Scrolls message from left to right
void scroll_left(){
  lcd.begin(16, 2);
  lcd.print("Scrolling message!");
  delay(1000);
    for (int positionCounter = 0; positionCounter < 18; positionCounter++) {
    // scroll one position left:
    lcd.scrollDisplayLeft();
    // wait a bit:
    delay(150);
  }
  delay(600);
}

//Scrolls message from right to left
void scroll_right(){
  lcd.begin(16, 2);
  lcd.print("Scrolling message!");
  delay(1000);
    for (int positionCounter = 0; positionCounter < 20; positionCounter++) {
    // scroll one position right:
    lcd.scrollDisplayRight();
    // wait a bit:
    delay(150);
  }
  delay(600);
  }

Credits

xristos_xatz
0 projects • 3 followers
Contact

Comments

Please log in or sign up to comment.