Thursday, April 30, 2009

The Final Presentation- Meowzers

Wow! I can't believe this project and semester is over. Time has seriously flown by and I am so proud of this final project. Here's the edited version of our field testing with Tigger set to music, Frankie Valli's & the Fours Seasons "Beggin'". A Warning to viewers: Tigger is FIERCE!


Here's the final video of Meowzers working, you’ll see us operating the device using a sketch that I wrote in Processing that features a cute cat cartoon cat that works as a “cursor” that directs the action of the two servos and triggers the laser pointer we embedded into the mouths of one of the four mouse heads that adorn the cat scratching post we modified. Moving the cat icon vertically activates the servo that controls the movement of a feather teaser, causing it to dip and rise to bait the cat to chase it. Moving the cat icon horizontally activates the servo that spins the crown of the scratching post, causing the mouse heads attached to the four posts emanating from the center post to shake in a wild fashion. Pressing the mouse on the computer triggers the laser pointer we embedded into one of the mouse heads.



Here’s the Processing Code:

import processing.serial.*;

Serial port; //Create object from Serial class.*;

PImage Cat1;
PImage Cat2;
void setup() {
imageMode(CENTER);
size (700,700);
Cat1 = loadImage(”Cat.jpg”);
Cat2 = loadImage (”Cat2.jpg”);
frameRate(30);
//Open the port that the board is connected to and use the same speed (9600bps)
port = new Serial(this, Serial.list()[0], 9600);
}

void draw() {
background (255);

//ellipse (mouseX, mouseY, 10,10);
//change color
float newmouseX = map (mouseX, 0, width, 0, 254);
float newmouseY = map (mouseY, 0, height, 0, 254);
port.write((byte)255); //start byte
port.write((byte)newmouseX);
port.write((byte)newmouseY);
if (mousePressed){
image(Cat2, mouseX, mouseY);
port.write((byte)4);
}
else {
image(Cat1, mouseX, mouseY);
port.write((byte)0);
}
}

And the Arduino code:

#include

Servo servoMotor1;
Servo servoMotor2;

int servo1 = 0; //Data received from the serial port
int servoPin1 = 9; //Set value servoPin to pin 9
int servo2 = 0; //Data received from the serial port
int servoPin2 = 10; //Set value servoPin to pin 9
int button = 0;
int buttonPin = 2;

void setup(){
servoMotor1.attach(servoPin1); //Sets pin as OUTPUT
servoMotor2.attach(servoPin2); //Sets pin as OUTPUT
pinMode(buttonPin, OUTPUT);
Serial.begin(9600); //Start serial communication at 9600bps
}

void loop()
{
if (Serial.available()>= 4){ //If 4 bytes are available to read,
int inByte = Serial.read ();
if (inByte == 255) {

servo1 = Serial.read(); //read serial and store it as val
servo1 = map(servo1, 0, 254, 179, 0);
servo2 = Serial.read(); //read serial and store it as val
servo2 = map(servo2, 0, 254, 179, 0);
button = Serial.read(); //read serial and store it as val

servoMotor1.write (servo1);
servoMotor2.write (servo2);
if (button == 4){
digitalWrite (buttonPin, HIGH);
}
else{
digitalWrite (buttonPin, LOW);
delay(25);
}
}
}
}

We consider this project to be a HUGE success, especially considering the little experience we had with programming prior to this class. We’re extremely grateful to all those who aided us, and our special thanks goes out to:

Jeremy Rotzstain, whose quick tutorial on Processing made our control device possible;

Adam Parrish, who helped us get our feet wet with Processing with his help session;

Todd Holoubek and Rory Nugent, whose suggestions on the P Comp side were invaluable;

Rob Faludi, whose last minute adjustment to our Arduino code literally calmed our jitters by solving the problem of our shaky servos;

Tigger Ryan, who did a wonderful job as our “test cat”;

our classmates, whose creativity, ambition, and brilliance inspired our efforts;

and finally, our teacher Scott Fitzgerald, who is one of the best teachers I've ever had and whose patience, knowledge, generosity, bad jokes and incisive feedback made this class so awesome.

I also have to give props to my PCOMP partner throughout the course, Gordie, whose woodworking/shop skills as well as understanding of electronics far surpass mine. He was great to work with, easygoing and up for any challenge and he always made the learning experience fun.

Monday, April 27, 2009

Meowzers...Make Cats Happy!








Here's a demo of our (almost) final project, Meowzers....Things are still a little shaky with the servos but we have an adorable, user friendly interface for cat owners to easily interact with their cat. Move Meowzers up/down and the Teazer Feather moves up/down, move Meowzers left and right on the screen and activate the spinning mice heads. Click on Meowzers and the lazer pointer activates. Hooray. Click below for a video demo by Gordie.

Sunday, April 26, 2009

Our Final Project....Meowzers!

Things are coming together at this point. We have both of the servos attached to the cat tree and our project is finally working. Here's a video of both servos working independently using a potentiometer. This project works for entertaining not only cats but everyone in the Pcomp lab!



Next we decided to user test the toy with my cat Tigger, apart from almost destroying Meowzers he had a great time playing with it:

We are now working on creating a user-friendly interface in processing so that lazy owners can access the meowzer remotely and bring hours of enjoyment to their cats!


Wednesday, April 15, 2009

Cat Entertainment Center...Final Project Week 2

Right now we're just working on the physical part of the project and this weekend we were able to get some of the elements of our cat amusement center to work.

We started on Saturday by heading over to Petland to buy a cat scratching post. We found a fashionable sky-blue model with mouse heads suspended from four rods situated around the top column of the post. Since the top column detaches from the bottom, we've decided to put a servo on the top column so it could rotate upon activation:



Next we decided to attach a servo to a dowel that we picked up from Home Depot. Our plan is to mount it to the top of the post and attach the feather toy with some string so the servo can mimic the action of pulling the line up and down to draw the cat ’s attention. Here’s the servo with the rod in action:



And finally we're thinking that we'd like to have a glowing LED ball that attracts the cat's attention while NOT electrocuting him/her. I made a protype of the glow ball and here's a video of it working here:

We’re still quite a ways from completion. We’re in the process of building a housing for the servos, and trying to figure out the triggering mechanism for the project. Sadly, it probably won’t be a web-based one, because after looking over the TweetMobile code, we both realized that we just don’t have enough programming experience to figure out how to adapt it for our purposes. Right now we’re looking into activating it through a radio transmitter/receiver set-up.

Wednesday, April 8, 2009

Final Project Observation

Thank you to Gordie for some amazing research on Evil Cat history, I had no ideas these little guys were so devious. Here is our proposal for the final project.

From the assassination of Archduke Franz Ferdinand, triggering the start of the First World War...
cat killing a duke

...to the katzen responsible for the carnage of the Second World War...
HItler Cat

...to the master criminals of today spreading their chaos throughout our society...
BatmanVsJoker

...cats have shown themselves to be the enemy of mankind.

Since idle paws are clearly the devil's workshop, we've decided to build a device that would allow cat owners to keep these devious creatures busy while they are away and their cats are home alone plotting other ways to bring ruin to mankind.

We observed one of these vicious creatures in his natural habitat...

...and since they appear to be distracted by simple movement, we intend to build a combination scratching post/cat amusement device.

The device will have a couple of motor driven arms that will dangle and swing a couple of cat toys to hopefully amuse the cat and keep it from hatching more evil schemes.

At the moment, the plan is to permit the owner to activate the device remotely using their Twitter account. The purpose of the cat play station is to help lonely kitties stave off boredom while their owners are away.

I hope this project helps busy cat owners everywhere.