Skip to content

Instantly share code, notes, and snippets.

@mike-pete
Created January 15, 2022 03:44
Show Gist options
  • Save mike-pete/72ad569da9d2d0700f290795f2eeedbf to your computer and use it in GitHub Desktop.
Save mike-pete/72ad569da9d2d0700f290795f2eeedbf to your computer and use it in GitHub Desktop.
Move the mouse back and forth to keep a computer awake
#include <DigiMouse.h>
#include <oddebug.h>
#include <osccal.h>
#include <osctune.h>
#include <usbconfig-prototype.h>
#include <usbconfig.h>
#include <usbdrv.h>
#include <usbportability.h>
void setup() {
pinMode(1, OUTPUT);
DigiMouse.begin(); //start
}
void loop() {
digitalWrite(1, HIGH);
DigiMouse.moveX(1); //
DigiMouse.delay(500);
digitalWrite(1, LOW);
DigiMouse.moveX(-1);
DigiMouse.delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment