Servo Mouse

We learned how to connect and program the servo motor in our last class. After practicing by working on some labs, I decided to experiment with making a puppet move. Though I don’t quite know what I want this mouse fellow to do I started off by programming the arduino to pivot to 180 degrees allowing the mouse to also rotate in this fashion.

#include <Servo.h>

Servo myServo;

void setup() {
myServo.attach(9);
}

void loop() {
int sensor = analogRead(A0);
int angle = map(sensor, 0, 1023, 0, 180);
myServo.write(angle);
delay(20);
}

Servo Mouse from hnikita on Vimeo.

Expanding upon the project:

 

Leave a Reply

Your email address will not be published.