Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Joystick.h>
- void setup() {
- pinMode(8, INPUT_PULLUP);
- pinMode(9, INPUT_PULLUP);
- Joystick.begin();
- }
- void loop() {
- // button 2 should be front finger, button 3 should be side thumb
- if (digitalRead(8) == LOW) //this is the number on the Arduino chip
- {
- Joystick.setButton(1, 1);//this is the number you change to invert the switch
- }
- else
- {
- Joystick.setButton(1, 0);//this number needs to be change to the oposite of the number above
- }
- if (digitalRead(9) == LOW) //this is the number on the Arduino chip
- {
- Joystick.setButton(2, 1); //this is the number you change to invert the switch
- }
- else
- {
- Joystick.setButton(2, 0); //this number needs to be change to the oposite of the number above
- }
- delay(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement