Advertisement
Ben-Blumenfeld

Untitled

Feb 20th, 2019
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. #include <Wire.h>
  2. #include <LiquidCrystal_I2C.h>
  3.  
  4.  
  5. //set the screen address to 0x27 for a 16 chars and 2 line desplay
  6. LiquidCrystal_I2C screen(0x3F, 16, 2);
  7. int tim=500;
  8.  
  9.  
  10. void setup() {
  11. //initialize the screen
  12. screen.begin();
  13. screen.setBacklight((uint8_t)1);
  14.  
  15.  
  16. }
  17.  
  18. void loop() {
  19. screen.setCursor (15,0);//set the cursor to column 15, line 0
  20. screen.print ("YOU");
  21. screen.setCursor (15,1);
  22. screen.print ("WIN!!!");
  23. for(int position1=0; position1 < 26; position1++)
  24. {
  25. screen.scrollDisplayLeft (); //Scrolls the contents of the display
  26. delay (tim); //wait for 250 microseconds
  27.  
  28. }
  29.  
  30. screen.clear();// Clears the screen and positions the cursor
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement