Advertisement
Guest User

Untitled

a guest
Sep 8th, 2015
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. const int ba = 0;
  2. const int bb = 1;
  3. const int bc = 2;
  4. const int bd = 3;
  5. const int be = 4;
  6. const int bf = 5;
  7. const int bg = 6;
  8. const int bh = 7;
  9. const int bi = 9;
  10. const int bj = 10;
  11. const int bk = 11;
  12. const int bl = 12;
  13. const int bm = 13;
  14. const int bn = A4;
  15. const int bo = A5;
  16.  
  17. int a = 0;
  18. int b = 0;
  19. int c = 0;
  20. int d = 0;
  21. int e = 0;
  22. int f = 0;
  23. int g = 0;
  24. int h = 0;
  25. int i = 0;
  26. int j = 0;
  27. int k = 0;
  28. int l = 0;
  29. int m = 0;
  30. int n = 0;
  31. int o = 0;
  32.  
  33. void setup() {
  34. pinMode(ba, INPUT);
  35. pinMode(bb, INPUT);
  36. pinMode(bc, INPUT);
  37. pinMode(bd, INPUT);
  38. pinMode(be, INPUT);
  39. pinMode(bf, INPUT);
  40. pinMode(bg, INPUT);
  41. pinMode(bh, INPUT);
  42. pinMode(bi, INPUT);
  43. pinMode(bj, INPUT);
  44. pinMode(bk, INPUT);
  45. pinMode(bl, INPUT);
  46. pinMode(bm, INPUT);
  47. pinMode(bn, INPUT);
  48. pinMode(bo, INPUT);
  49. Serial.begin(9600);
  50.  
  51. }
  52.  
  53. void loop(){
  54. a = digitalRead(ba);
  55. b = digitalRead(bb);
  56. c = digitalRead(bc);
  57. d = digitalRead(bd);
  58. e = digitalRead(be);
  59. f = digitalRead(bf);
  60. g = digitalRead(bg);
  61. h = digitalRead(bh);
  62. i = digitalRead(bi);
  63. j = digitalRead(bj);
  64. k = digitalRead(bk);
  65. l = digitalRead(bl);
  66. m = digitalRead(bm);
  67. n = digitalRead(bn);
  68. o = digitalRead(bo);
  69.  
  70. if(a == HIGH)
  71. {
  72. char x[4] = "a1";
  73. Serial.print(x);
  74. }
  75. if(b == HIGH)
  76. {
  77. char x[4] = "b1";
  78. Serial.print(x);
  79. }
  80. if(c == HIGH)
  81. {
  82. char x[4] = "c1";
  83. Serial.print(x);
  84. }
  85. if(d == HIGH)
  86. {
  87. char x[4] = "d1";
  88. Serial.print(x);
  89. }
  90. if(e == HIGH)
  91. {
  92. char x[4] = "e1";
  93. Serial.print(x);
  94. }
  95. if(f == HIGH)
  96. {
  97. char x[4] = "f1";
  98. Serial.print(x);
  99. }
  100. if(g == HIGH)
  101. {
  102. char x[4] = "g1";
  103. Serial.print(x);
  104. }
  105. if(h == HIGH)
  106. {
  107. char x[4] = "h1";
  108. Serial.print(x);
  109. }
  110. if(i == HIGH)
  111. {
  112. char x[4] = "i1";
  113. Serial.print(x);
  114. }
  115. if(j == HIGH)
  116. {
  117. char x[4] = "j1";
  118. Serial.print(x);
  119. }
  120. if(k == HIGH)
  121. {
  122. char x[4] = "k1";
  123. Serial.print(x);
  124. }
  125. if(l == HIGH)
  126. {
  127. char x[4] = "l1";
  128. Serial.print(x);
  129. }
  130. if(m == HIGH)
  131. {
  132. char x[4] = "m1";
  133. Serial.print(x);
  134. }
  135. if(n == HIGH)
  136. {
  137. char x[4] = "n1";
  138. Serial.print(x);
  139. }
  140. if(o == HIGH)
  141. {
  142. char x[4] = "o1";
  143. Serial.print(x);
  144. }
  145. Serial.println();
  146. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement