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:

 

66 thoughts on “Servo Mouse”

  1. I enjoy you because of all of your effort on this website. Betty enjoys going through investigations and it’s really obvious why. Most people notice all regarding the lively form you render sensible suggestions on your web blog and therefore foster response from some other people on that issue so our own daughter is without a doubt starting to learn so much. Enjoy the rest of the year. You are carrying out a splendid job.

  2. Great goods from you, man. I’ve understand your stuff previous to and you’re just extremely excellent. I actually like what you have acquired here, certainly like what you are saying and the way in which you say it. You make it enjoyable and you still take care of to keep it sensible. I can not wait to read much more from you. This is actually a wonderful web site.

Leave a Reply

Your email address will not be published.