Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Mouse.h>
- int buttonPin = 10; // Set a button to any pin
- void setup()
- {
- pinMode(buttonPin, INPUT); // Set the button as an input
- digitalWrite(buttonPin, HIGH); // Pull the button high
- }
- void loop()
- {
- if (digitalRead(buttonPin) == 0) // if the button goes low
- {
- Mouse.press();
- delay(1);
- }
- else {Mouse.release();}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement