Tuesday, May 20, 2014

Final Project

For my final project, I decided it would be fun to make a virtual pet rock with processing.


 First, I planned it out.  I decided I'd have three inputs from the arduino that processing would read.  I planned on a accelerometer for moving the rock around, and a thermistor and photoresistor for changing the rock's environment and his mood.  I was worried that drawing all of this in processing would be a daunting task, but then I figured out that processing can load in external svg images.

So, I made several images in Inkscape that are used to draw the rock.  The rock is made up of 5 components.  The base rock, the eyebrows, the eyes, the nose, and the mouth.  There are three sets of eyebrows (angry, distressed, normal), three sets of eyes (left, right, normal), two noses (normal and running), two mouths (normal and frowning), and just one base rock.  These components are drawn based on input from the sensors.Tilting his home left and right causes him to move left and right, back and forth causes him to move up and down, and if he ends up moving fast enough, he gets angry.  The light sensor affects the light level in his home, and if it's low enough, he gets distressed.  He also gets distressed if it gets too hot or too cold, and in the case of the latter, his nose will start running.


The pet rock's home, for now, is a mere cardboard box, seen in the first image.  Hook the box up to the computer with a micro usb <-> USB cable, and you can play with the pet rock.