Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Wire.h>
- #include <LiquidCrystal_I2C.h>
- // initialize the library by associating any needed LCD interface pin
- // with the arduino pin number it is connected to
- LiquidCrystal_I2C lcd(0x27, 16, 2);
- int kek=0;
- int dlugosc, ile=0;
- String msg = "MILY DZIADZIO";
- void setup() {
- lcd.init();
- lcd.backlight();
- dlugosc = msg.length();
- /* lcd.setCursor(0, 0);
- lcd.print("DL:");
- lcd.print(dlugosc);
- delay(2000);
- lcd.clear();
- lcd.setCursor(0, 0);
- lcd.print("Test:");
- lcd.print(msg[1]);
- delay(2000);
- lcd.clear();
- */
- lcd.setCursor(16-dlugosc, 0);
- lcd.print(msg);
- lcd.setCursor(0, 1);
- delay(1000);
- ile= 17- dlugosc;
- for (int positionCounter = 0; positionCounter < ile; positionCounter++) {
- kek++;
- delay(500);
- lcd.scrollDisplayLeft();
- }
- for(int i=0; i<15; i++){
- kek++;
- if(i<dlugosc){
- lcd.setCursor(kek+14, 1);
- lcd.print(msg[i]);
- }
- delay(500);
- lcd.scrollDisplayLeft();
- }
- for(int i=0; i<kek; i++){
- delay(500);
- lcd.scrollDisplayRight();
- }
- }
- void loop() {
- }
Add Comment
Please, Sign In to add comment