Advertisement
krylovilya

Untitled

Jan 17th, 2017
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.08 KB | None | 0 0
  1. #include <LiquidCrystal_I2C.h>
  2. #include <Wire.h>
  3. #include <math.h>
  4.  
  5. LiquidCrystal_I2C lcd(0x3F,16,2);
  6.  
  7. char str[11][16]
  8. {
  9.   "Нексус идеален!",
  10.   "Nexus idealen!",
  11.   "I Hate Apple",
  12.   "Apple is shit.",
  13.   "Google is good.",
  14.   "MS is shit.",
  15.   "Everything aro",
  16.   "und is shit.",
  17.   "Life han",
  18.   "no sence.",
  19.   "Fuck all."
  20. };
  21. void pausa(int x, int y) {
  22.   if (y != 6 && y != 8) delay(1000);
  23.   if (y == 7 || y == 9) delay(1000);
  24.   for (int i = 0; i < 16; ++i)
  25.     {  lcd.setCursor(i, x);   lcd.print(" ");}
  26.   if (y == 7 || y == 9) lcd.clear();
  27.   if (y != 6 && y != 8) {
  28.  
  29.   for (int i = 0; i < 3; ++i) {
  30.   lcd.setCursor(0, x);
  31.   lcd.print("_");
  32.   delay(500);
  33.   lcd.setCursor(0, x);
  34.   lcd.print(" ");
  35.   delay(500);
  36.   }
  37.   }
  38. }
  39. void setup() {
  40.  
  41. lcd.init();          
  42. lcd.backlight();
  43. int x;
  44. delay(5000);
  45. for (int i = 0; i < 11; ++i) {
  46.   if (i % 2 != 0) x = 1; else x = 0;
  47.   for (int j = 0; j < strlen(str[i]); ++j) {
  48.     lcd.setCursor(j, x);
  49.     lcd.print(str[i][j]);
  50.     delay(100);
  51.     }  
  52.   pausa(abs(x-1), i);
  53.   }
  54. lcd.clear();
  55. }
  56.  
  57. void loop() {
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement