Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.19 KB | None | 0 0
  1. #include "LedControl.h"
  2.  
  3. /*
  4. A = {B01111110, B10001000, B10001000, B10001000, B01111110};
  5. B = {B01101100, B10010010, B10010010, B10010010, B11111110};
  6. C = {B01000100, B01000100, B01000100, B01000100, B01111100};
  7. D = {B01111100, B10000010, B10000010, B10000010, B11111110};
  8. E = {B10000010, B10010010, B10010010, B10010010, B01111100};
  9. H = {B11111110, B00010000, B00010000, B00010000, B11111110};
  10. I = {B00000000, B00000000, B00000000, B00000000, B11111110};
  11. K = {B10000010, B01000100, B00101000, B00010000, B11111110};
  12. L = {B00000010, B00000010, B00000010, B00000010, B11111110};
  13. N = {B11111110, B00011000, B00110000, B01100000, B11111110};
  14. O = {B01111100, B10000010, B10000010, B10000010, B01111100};
  15. S = {B10001100, B10010010, B10010010, B10010010, B01100010};
  16. T = {B10000000, B10000000, B11111110, B10000000, B10000000};
  17. U = {B11111100, B00000010, B00000010, B00000010, B11111100};
  18.  
  19. _ = {B00000010, B00000010, B00000010, B00000010, B00000010};
  20. */
  21.  
  22.  
  23. byte snake [5] [5] = {{B10001100, B10010010, B10010010, B10010010, B01100010}, //S
  24. {B11111110, B00011000, B00110000, B01100000, B11111110}, //N
  25. {B01111110, B10001000, B10001000, B10001000, B01111110}, //A
  26. {B10000010, B01000100, B00101000, B00010000, B11111110}, //K
  27. {B10000010, B10010010, B10010010, B10010010, B01111100} //E
  28. };
  29.  
  30. byte heil_at [7] [5] = {{B11111110, B00010000, B00010000, B00010000, B11111110}, //H
  31. {B10000010, B10010010, B10010010, B10010010, B01111100}, //E
  32. {B00000000, B00000000, B00000000, B00000000, B11111110}, //I
  33. {B00000010, B00000010, B00000010, B00000010, B11111110}, //L
  34. {B00000010, B00000010, B00000010, B00000010, B00000010}, //_
  35. {B01111110, B10001000, B10001000, B10001000, B01111110}, //A
  36. {B10000000, B10000000, B11111110, B10000000, B10000000} //T
  37. };
  38.  
  39.  
  40. byte smile_gif [2] [8] =
  41. {
  42. {B00111100, B01011110, B11010111, B11110111, B11110111, B11010111, B01011110, B00111100},
  43. {B00111100, B01111110, B11010111, B11110011, B11110011, B11010111, B01111110, B00111100}
  44. };
  45.  
  46. byte something [14] [8] =
  47. {
  48. {B00111100, B01011110, B11010111, B11110111, B11110111, B11010111, B01011110, B00111100},
  49. {B00111100, B01111110, B11010111, B11110011, B11110011, B11010111, B01111110, B00111100},
  50. {B00111100, B01011110, B11010111, B11110111, B11110111, B11010111, B01011110, B00111100},
  51. {B00111100, B01111110, B11010111, B11110011, B11110011, B11010111, B01111110, B00111100},
  52. {B00111100, B01011110, B11010111, B11110111, B11110111, B11010111, B01011110, B00111100},
  53. {B00111100, B01111110, B11010111, B11110011, B11110011, B11010111, B01111110, B00111100},
  54. {B00111100, B01011110, B11010111, B11110111, B11110111, B11010111, B01011110, B00111100},
  55. {B00111100, B01111110, B11010111, B11110011, B11110011, B11010111, B01111110, B00111100},
  56. {B00111100, B01011110, B11010111, B11110111, B11110111, B11010111, B01011110, B00111100},
  57. {B00111100, B01111110, B11010111, B11110011, B11110011, B11010111, B01111110, B00111100},
  58. {B00111100, B01011110, B11010111, B11110111, B11110111, B11010111, B01011110, B00111100},
  59. {B00111100, B01111110, B11010111, B11110011, B11110011, B11010111, B01111110, B00111100},
  60. {B00111100, B01011110, B11010111, B11110111, B11110111, B11010111, B01011110, B00111100},
  61. {B00111100, B01111110, B11010111, B11110011, B11110011, B11010111, B01111110, B00111100}
  62. };
  63.  
  64. LedControl lc = LedControl(49, 53, 51, 1);
  65. const byte x = B11111111;
  66.  
  67. ///////////////////////////////////////////////////////////////////////////////////////////////// end variables declaration/definition
  68.  
  69. void setup()
  70. {
  71. lc.shutdown(0, false);
  72. lc.setIntensity(0, 3);
  73. lc.clearDisplay(0);
  74. }
  75.  
  76. void txt(int columns, int rows, int offset, byte **object)
  77. {
  78. for (int i = 0; i < columns; i++)
  79. {
  80. for (int j = 0; j < rows; j++)
  81. {
  82. lc.setRow(0, j + offset, object[i] [j]);
  83. }
  84. delay(1000);
  85. }
  86.  
  87. delay(1000);
  88.  
  89. for (int i = 0; i <= 7; i++)
  90. {
  91.  
  92. lc.setRow(0, i, x);
  93. delay(100);
  94. }
  95.  
  96. delay(50);
  97. lc.clearDisplay(0);
  98. }
  99.  
  100. void loop()
  101. {
  102. txt(2, 8, 0, smile_gif);
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement