Drakkheen

Untitled

Mar 3rd, 2021
689
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int speed = 100;
  2.  
  3. int spalte[] = {8, 7, 6, 5, 4};
  4. int zeile[] = {13, 12, 11, 10, 9};
  5.  
  6. byte A [] = {B01100, B10010, B11110, B10010, B10010};
  7. byte B [] = {B11100, B10010, B11110, B10010, B11100};
  8. byte C [] = {B01110, B10000, B10000, B10000, B01110};
  9. byte D [] = {B11100, B10010, B10010, B10010, B11100};
  10. byte E [] = {B11110, B10000, B11100, B10000, B11110};
  11. byte F [] = {B11110, B10000, B11100, B10000, B10000};
  12. byte G [] = {B01110, B10000, B10110, B10010, B11110};
  13. byte H [] = {B10010, B10010, B11110, B10010, B10010};
  14. byte I [] = {B00100, B00100, B00100, B00100, B00100};
  15. byte J [] = {B00100, B00100, B00100, B10100, B11100};
  16. byte K [] = {B10010, B10100, B11000, B10100, B10010};
  17. byte L [] = {B10000, B10000, B10000, B10000, B11110};
  18. byte M [] = {B10001, B11011, B10101, B10001, B10001};
  19. byte N [] = {B10010, B11010, B10110, B10010, B10010};
  20. byte O [] = {B01100, B10010, B10010, B10010, B01100};
  21. byte P [] = {B11100, B10010, B10010, B11100, B10000};
  22. byte Q [] = {B01110, B10001, B10101, B10010, B01101};
  23. byte R [] = {B11100, B10010, B11100, B10010, B10010};
  24. byte S [] = {B11110, B10000, B11110, B00010, B11110};
  25. byte T [] = {B11111, B00100, B00100, B00100, B00100};
  26. byte U [] = {B10010, B10010, B10010, B10010, B01100};
  27. byte V [] = {B10001, B10001, B10001, B01010, B00100};
  28. byte W [] = {B10001, B10001, B10101, B10101, B01110};
  29. byte X [] = {B10010, B10010, B01100, B10010, B10010};
  30. byte Y [] = {B10001, B10001, B01110, B00100, B00100};
  31. byte Z [] = {B11110, B00010, B00100, B01000, B11110};
  32. byte EX [] = {B00000, B00000, B00000, B00000, B00000};
  33. byte ALL [] = {B11111, B11111, B11111, B11111, B11111};
  34. byte smile [] = {B01010, B00000, B00100, B10001, B01110};
  35. byte frown [] = {B10001, B00100, B00000, B01110, B10001};
  36.  
  37. float timeCount = 0;
  38.  
  39. void setup() {
  40.  
  41.   for (int i = 4; i < 14; i++) {
  42.     pinMode(i, OUTPUT);
  43.   }
  44.  
  45. }
  46.  
  47. void loop() {
  48.  
  49.   timeCount += 1;
  50.  
  51.   if (timeCount <  2000)
  52.   {
  53.     showS();
  54.   }
  55.   else if (timeCount <  4000)
  56.   {
  57.     showT();
  58.   }
  59.   else if (timeCount <  6000)
  60.   {
  61.     showW();
  62.   }
  63.    else if (timeCount <  8000)
  64.   {
  65.     showsmile();
  66.   }
  67.  
  68.   else if (timeCount <  10000)
  69.   {
  70.     showEX();
  71.   }
  72.  
  73.   else {
  74.     // back to the start
  75.     timeCount = 0;
  76.   }
  77. }
  78.  
  79. void showS() {
  80.   for (int a = 0; a <= 4; a++) {
  81.     digitalWrite(zeile[a], 1);
  82.     for (int i = 0; i < 5; i++) {
  83.       digitalWrite(spalte[i], bitRead(S[a], i));
  84.       digitalWrite(spalte[i], 0);
  85.     }
  86.     digitalWrite(zeile[a], 0);
  87.   }
  88. }
  89. void showT() {
  90.   for (int a = 0; a <= 4; a++) {
  91.     digitalWrite(zeile[a], 1);
  92.     for (int i = 0; i < 5; i++) {
  93.       digitalWrite(spalte[i], bitRead(T[a], i));
  94.       digitalWrite(spalte[i], 0);
  95.     }
  96.     digitalWrite(zeile[a], 0);
  97.   }
  98. }
  99. void showW() {
  100.   for (int a = 0; a <= 4; a++) {
  101.     digitalWrite(zeile[a], 1);
  102.     for (int i = 0; i < 5; i++) {
  103.       digitalWrite(spalte[i], bitRead(W[a], i));
  104.       digitalWrite(spalte[i], 0);
  105.     }
  106.     digitalWrite(zeile[a], 0);
  107.   }
  108. }
  109.   void showEX() {
  110.     for (int a = 0; a <= 4; a++) {
  111.       digitalWrite(zeile[a], 1);
  112.       for (int i = 0; i < 5; i++) {
  113.         digitalWrite(spalte[i], bitRead(EX[a], i));
  114.         digitalWrite(spalte[i], 0);
  115.       }
  116.       digitalWrite(zeile[a], 0);
  117.     }
  118.   }
  119.  
  120.     void showsmile() {
  121.     for (int a = 0; a <= 4; a++) {
  122.       digitalWrite(zeile[a], 1);
  123.       for (int i = 0; i < 5; i++) {
  124.         digitalWrite(spalte[i], bitRead(smile[a], i));
  125.         digitalWrite(spalte[i], 0);
  126.       }
  127.       digitalWrite(zeile[a], 0);
  128.     }
  129.   }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×