Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Mouse.h>
- #include <Keyboard.h>
- #define switchOne 2
- #define switchTwo 3
- #define switchThree 4
- #define switchFour 5
- #define switchFive 6
- #define switchSix 7
- #define switchSeven 8
- #define switchEight 9
- #define switchNine 10
- void setup() {
- // put your setup code here, to run once:
- pinMode (2, INPUT_PULLUP);
- pinMode (3, INPUT_PULLUP);
- pinMode (4, INPUT_PULLUP);
- pinMode (5, INPUT_PULLUP);
- pinMode (6, INPUT_PULLUP);
- pinMode (7, INPUT_PULLUP);
- pinMode (8, INPUT_PULLUP);
- pinMode (9, INPUT_PULLUP);
- pinMode (10, INPUT_PULLUP);
- Keyboard.begin();
- Mouse.begin();
- }
- void loop() {
- // put your main code here, to run repeatedly:
- //Switch 1//
- if (digitalRead(switchOne) == LOW)
- {
- //Code Here
- }
- if (digitalRead(switchOne) == HIGH)
- {
- //Code Here
- }
- //Switch 2//
- if (digitalRead(switchTwo) == LOW)
- {
- //Code Here
- }
- if (digitalRead(switchTwo) == HIGH)
- {
- //Code Here
- }
- //Switch 3//
- if (digitalRead(switchThree) == LOW)
- {
- //Code Here
- }
- if (digitalRead(switchThree) == HIGH)
- {
- //Code Here
- }
- //Switch 4//
- if (digitalRead(switchFour) == LOW)
- {
- //Code Here
- }
- if (digitalRead(switchFour) == HIGH)
- {
- //Code Here
- }
- //Switch 5//
- if (digitalRead(switchFive) == LOW)
- {
- //Code Here
- }
- if (digitalRead(switchFive)==HIGH)
- {
- //Code Here
- }
- //Switch 6//
- if (digitalRead(switchSix) == LOW)
- {
- //Code Here
- }
- if (digitalRead(switchSix) == HIGH)
- {
- //Code Here
- }
- //Switch 7//
- if (digitalRead(switchSeven) == LOW)
- {
- //Code Here
- }
- if (digitalRead(switchSeven) == HIGH)
- {
- //Code Here
- }
- //Switch 8//
- if (digitalRead(switchEight) == LOW)
- {
- //Code Here
- }
- if (digitalRead(switchEight) == HIGH)
- {
- //Code Here
- }
- //Switch 9//
- if (digitalRead(switchNine) == LOW)
- {
- //Code Here
- }
- if (digitalRead(switchNine) == HIGH)
- {
- //Code Here
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement