Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
ihacklab
Published © GPL3+

Work from Home Automatic Mouse Mover

A work-from-home mouse, digital and analog, designed to move automatically as if someone is working on the computer.

BeginnerShowcase (no instructions)6,992
Work from Home Automatic Mouse Mover

Things used in this project

Hardware components

SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Arduino UNO
Arduino UNO
×1
9V battery (generic)
9V battery (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Story

Read more

Schematics

Mouse Mover Layout

Code

Mouse Mover Sketch

Arduino
/* =============================================================== <br>
      Project: Microservo SG90 <br>
      Author: J. B. Wylzan <br>
      Website: http://myarduinoscratchbook.blogspot.com <br>
      Abstract: How to activate a servo <br>
================================================================== */ <br>
<br>
#include <servo .h> <br>
int x = 1000 <br>
<br>
Servo servo; <br>                          
<br>
void setup() <br>
{ <br>
   servo.attach(9); <br>                 
} <br>
<br>
void loop() <br>
{ <br>
    servo.write(90);   <br>                
   delay(x);               <br>                
   servo.write(45);              <br>      
   delay(x);                         <br>      
   servo.write(90);                    <br>
   delay(x);                               <br>
   servo.write(135);   <br>               
   delay(x);               <br>                
   servo.write(0);             <br>         
   delay(x);                       <br>       
   servo.write(180);                 <br>
   delay(x);                             <br> 
} <br>
<br>
<br>

Credits

ihacklab
12 projects • 22 followers

Comments