The Cat and Mouse functions as a decorative desk toy. As the mouse runs back and forth, you can move the cat’s paw up and down as if to catch the mouse, making the toy interactive.  It also functions as a stress-reliever since the repetitive motion of the mouse is calming to watch.

The mouse’s movement is controlled by the servo motor which is programmed with a for loop to make its movements appear less jerky. However, the mouse’s movements could be even smoother if the cardboard support beneath the motor were made sturdier. The acrylic top allows anyone to view the mechanism turning the mouse. The Cat and Mouse can also be viewed from any angle, meaning anyone in the room can easily see the mechanism despite being built with only 2D parts.

 

 

#include <Servo.h>
Servo myServo;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  myServo.attach(9);
  myServo.write(0);
}

void loop() {
  // put your main code here, to run repeatedly:
  for(int pos=0; pos <= 180; pos++){ myServo.write(pos); delay(20); } for(int pos=180; pos >= 0; pos--){
    myServo.write(pos);
    delay(20);
  }

}