Advertisement
Guest User

Untitled

a guest
Apr 28th, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. #include <Mouse.h>
  2. #include <Keyboard.h>
  3.  
  4. #define switchOne 2
  5. #define switchTwo 3
  6. #define switchThree 4
  7. #define switchFour 5
  8. #define switchFive 6
  9. #define switchSix 7
  10. #define switchSeven 8
  11. #define switchEight 9
  12. #define switchNine 10
  13.  
  14. void setup() {
  15. // put your setup code here, to run once:
  16. pinMode (2, INPUT_PULLUP);
  17. pinMode (3, INPUT_PULLUP);
  18. pinMode (4, INPUT_PULLUP);
  19. pinMode (5, INPUT_PULLUP);
  20. pinMode (6, INPUT_PULLUP);
  21. pinMode (7, INPUT_PULLUP);
  22. pinMode (8, INPUT_PULLUP);
  23. pinMode (9, INPUT_PULLUP);
  24. pinMode (10, INPUT_PULLUP);
  25. Keyboard.begin();
  26. Mouse.begin();
  27.  
  28. }
  29.  
  30. void loop() {
  31. // put your main code here, to run repeatedly:
  32.  
  33. //Switch 1//
  34. if (digitalRead(switchOne) == LOW)
  35. {
  36. //Code Here
  37. }
  38. if (digitalRead(switchOne) == HIGH)
  39. {
  40. //Code Here
  41. }
  42.  
  43. //Switch 2//
  44. if (digitalRead(switchTwo) == LOW)
  45. {
  46. //Code Here
  47. }
  48. if (digitalRead(switchTwo) == HIGH)
  49. {
  50. //Code Here
  51. }
  52.  
  53. //Switch 3//
  54. if (digitalRead(switchThree) == LOW)
  55. {
  56. //Code Here
  57. }
  58. if (digitalRead(switchThree) == HIGH)
  59. {
  60. //Code Here
  61. }
  62.  
  63. //Switch 4//
  64. if (digitalRead(switchFour) == LOW)
  65. {
  66. //Code Here
  67. }
  68. if (digitalRead(switchFour) == HIGH)
  69. {
  70. //Code Here
  71. }
  72.  
  73. //Switch 5//
  74. if (digitalRead(switchFive) == LOW)
  75. {
  76. //Code Here
  77. }
  78. if (digitalRead(switchFive)==HIGH)
  79. {
  80. //Code Here
  81. }
  82.  
  83. //Switch 6//
  84. if (digitalRead(switchSix) == LOW)
  85. {
  86. //Code Here
  87. }
  88. if (digitalRead(switchSix) == HIGH)
  89. {
  90. //Code Here
  91. }
  92.  
  93. //Switch 7//
  94. if (digitalRead(switchSeven) == LOW)
  95. {
  96. //Code Here
  97. }
  98. if (digitalRead(switchSeven) == HIGH)
  99. {
  100. //Code Here
  101. }
  102.  
  103. //Switch 8//
  104. if (digitalRead(switchEight) == LOW)
  105. {
  106. //Code Here
  107. }
  108. if (digitalRead(switchEight) == HIGH)
  109. {
  110. //Code Here
  111. }
  112.  
  113. //Switch 9//
  114. if (digitalRead(switchNine) == LOW)
  115. {
  116. //Code Here
  117. }
  118. if (digitalRead(switchNine) == HIGH)
  119. {
  120. //Code Here
  121. }
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement