Arduino Mouse Jiggler

By telleropnul, December 14, 2019

This requires a genuine Arduino Pro Micro with ATmega 32U4 chip with dedicated onboard USB transceiver hardware.  This allows the micro controller core to act as a USB mouse.

#include <Mouse.h>

/*
* NAME: Arduino Mouse Jiggler
* DATE: 2020-04-20
* DESC: Arduino based mouse emulator
* VERSION: 1.0
*/

int move_interval = 100; // 0.1 seconds
int loop_interval = 10000; // 10 seconds

void setup()
{
  Serial.begin(9600);
  randomSeed(analogRead(0));
  Mouse.begin();
}

void loop()
{
  Mouse.move(5, 0, 0);
  delay(move_interval);
  Mouse.move(0, 5, 0);
  delay(move_interval);
  Mouse.move(-5, 0, 0);
  delay(move_interval);
  Mouse.move(0, -5, 0);
  delay(move_interval);
  delay(loop_interval);
}