SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Wire.h>
  2. #include <LiquidCrystal_I2C.h>
  3. LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
  4.  
  5. byte ciuchcia1[8] = {
  6.   B01010,
  7.   B01011,
  8.   B01101,
  9.   B01001,
  10.   B11111,
  11.   B11111,
  12.   B00100,
  13. };
  14.  
  15. byte ciuchcia2[8] = {
  16.   B01001,
  17.   B11111,
  18.   B10101,
  19.   B10101,
  20.   B11111,
  21.   B11111,
  22.   B10010,
  23. };
  24.  
  25. byte ciuchcia3[8] = {
  26.   B00100,
  27.   B11111,
  28.   B10001,
  29.   B10001,
  30.   B11111,
  31.   B11111,
  32.   B01001,
  33. };
  34.  
  35. byte wagonik1[8] = {
  36.   B10001,
  37.   B11111,
  38.   B11111,
  39.   B10101,
  40.   B10101,
  41.   B11111,
  42.   B01010,
  43. };
  44.  
  45. byte wagonik2[8] = {
  46.   B00010,
  47.   B11111,
  48.   B10001,
  49.   B10001,
  50.   B11111,
  51.   B11111,
  52.   B01001,
  53. };
  54.  
  55.  
  56. byte wagonik3[8] = {
  57.   B00000,
  58.   B11100,
  59.   B10111,
  60.   B10111,
  61.   B11111,
  62.   B11111,
  63.   B01010,
  64. };
  65.  
  66.  
  67. void setup()
  68. {
  69. lcd.begin(16,1);                //inicjacja LCD
  70.   /*
  71. //****************************************************
  72.   for(int i = 0; i< 3; i++)     // pętla mrugania podświetlania na starcie
  73.   {
  74.     lcd.backlight();
  75.     delay(100);
  76.     lcd.noBacklight();
  77.     delay(100);
  78.   }
  79. //****************************************************
  80.  
  81.   lcd.backlight();              //właczenie podświetlania
  82.  
  83. delay(100);
  84.  
  85.  lcd.createChar(0, ciuchcia1);    //tworzenie znaków składających się na pociąg
  86.  lcd.createChar(1, ciuchcia2);
  87.  lcd.createChar(2, ciuchcia3);
  88.  lcd.createChar(3, wagonik1);
  89.  lcd.createChar(4, wagonik2);
  90.  lcd.createChar(5, wagonik3);
  91.  
  92. lcd.display();
  93. lcd.setCursor(0,0);
  94.  
  95.   lcd.write(byte(0));   //parowozik
  96.   lcd.write(byte(1));
  97.   lcd.write(byte(2));
  98.  
  99.   lcd.write(byte(3));   //wagonik
  100.   lcd.write(byte(4));
  101.   lcd.write(byte(5));
  102.  
  103.   lcd.write(byte(3));   //wagonik
  104.   lcd.write(byte(4));
  105.   lcd.write(byte(5));
  106.  
  107.   lcd.write(byte(3));   //wagonik
  108.   lcd.write(byte(4));
  109.   lcd.write(byte(5));
  110.  
  111.   lcd.write(byte(3));   //wagonik
  112.   lcd.write(byte(4));
  113.   lcd.write(byte(5));
  114. */
  115.  
  116. lcd.print("-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.");
  117. }
  118.  
  119. void loop() //pętla główna
  120. {
  121.   delay (200);
  122.   lcd.scrollDisplayLeft ();
  123. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top