Skip to content

Instantly share code, notes, and snippets.

@Boot-Error
Created April 4, 2021 18:10
Show Gist options
  • Select an option

  • Save Boot-Error/394b2102a1a23b8baf0bc80c18ebe898 to your computer and use it in GitHub Desktop.

Select an option

Save Boot-Error/394b2102a1a23b8baf0bc80c18ebe898 to your computer and use it in GitHub Desktop.
#include <DigiMouse.h>
// wait for DELAY_MINUTES, this is less than your
// screen saver's timeout
#define DELAY_MINUTES 2
void setup(){
DigiMouse.begin();
pinMode(1, OUTPUT);
}
void loop() {
while(true) {
// blinks the on-board LED to indicate mouse movement
digitalWrite(1, HIGH);
// moves the cursor right 30px
DigiMouse.move(30 ,0,0);
DigiMouse.delay(50);
// move the cursor left 30px
DigiMouse.move(-30,0,0);
digitalWrite(1, LOW)
DigiMouse.delay(DELAY_MINUTES * 60000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment