יום שבת, 2 ביוני 2012

Robot eyes follow your mouse pointer

(Click image to watch the video)


Never out of my sight: This creature will watch your mouse's every move.

Not so much because it's programmed to, but because it's suspicious (and a bit jealous).

How does it work?

Here's the data flow:
On the PC, a Java program captures the mouse movements. The code is simple, but I didn't know how to do it before. Uncle google helped.

The same program transmits the mouse coordinates (currently only x) to an Arduino via the serial port.

The Arduino has a library for working with servos, so it's straightforward to pass the serial input to the servos.

The servos are mounted to the bottom of the monitor and the 'eyes' are glued onto their arms.

 The image on the side was taken by looking upwards... the angle is a bit funny but I wanted to show how the servos fit in the setup.







Wait, that reminds me of the in Pac-Man!

A total coincidence. And I don't mind them using it.


Thanks for reading!
L10R
 

אין תגובות:

הוסף רשומת תגובה