Square Mouse Drawer
Square Mouse Drawer
What I wanted to learn, and why it interested me: I thought it would be fun to learn how to write to mouse/keyboard, no particular reason.
Final outcome: The board when plugged into a computer, that accepts mouse inputs, will hold and drag the mouse diagonally, the mouse is equivalently at 100 pixels downward then 100 pixels right.
Final Documentation
Image of the Arduino pro micro board setup to draw.
Mouse drawing on Inkscape using the rectangle tool with the button input as the drawer.
Process Video
Initial keyboard typing.
Process and reflection:
Initially my first goal was to make a button that would type on the keyboard with a simple press. The largest issue with this was not realizing the Arduino pro micro board I was using had not been fully soldered. This realization took most of my time to fix. Upon fixing the issue setting up a safety pullout pin was simple enough.
Upon moving to the next part I was able to quickly implement the keyboard button press and mouse commands within a short amount of time. To test the mouse inputs I considered Inkcsape to be the best test subject given it is a vector designing program that would certainly have a rectangle tool.
Technical details
Electrical schematic.
Functional Diagram
/*
60-223 Intro to Physical Computing, fall 2025
Domain-specific Skill Building exercise: Square Mouse Drawer
Code intended for the Arduino Pro Micro Board, it will hold the mouse, moving it diagonally
for 100 x 100 pixels downward to the bottom right of a screen from where the mouse is.
Pin mapping:
Arduino pin | role | details
------------------------------
10 input Safety plug
9 input Button to draw
*/
include "Mouse.h"
const static uint16_t SAFETY_PIN = 10;
const static uint16_t BUTTON_PIN = 9;
void setup() {
pinMode (SAFETY_PIN, INPUT_PULLUP);
pinMode (BUTTON_PIN, INPUT);
Serial.begin (9600);
Mouse.begin();
}
void loop() {
while (digitalRead(SAFETY_PIN) == HIGH){
Serial.print ("Safety pin is unplugged, safety pin at: ");
Serial.println (SAFETY_PIN);
delay (1000);
}
if (digitalRead (BUTTON_PIN)){
Mouse.press();
Mouse.move(100, 100, 0);
Mouse.release();
delay (150);
}
}