Monday, August 18, 2008

Michael McDonald

So, I never really thought to much of this guy. I was vaguely aware of "Yah Mo B There" and none to impressed (but, who am I too judge?). But, amazingly, I just read that he was involved in both Steely Dan and The Doobie Brothers. What the hell? Mr. McDonald, I apologize for ever questioning you. Two of the greatest bands of the 70's?!?! Jesus, I'm an idiot for ever doubting.

In related news, Paris Hilton officially rocks balls:

See more Paris Hilton videos at Funny or Die

Wednesday, August 6, 2008

Dune

The novel (not the movies) is one of the greatest pieces of art in the last 50 years. Its astute and almost prescient observations of the importance of Mid-Eastern oil in politics, global-economics, religion, and culture earns it:

Monday, August 4, 2008

No. 1 on my birthday

What song was number one on the day I was born?

Escape (The Pina Colada Song) - Rupert Holmes

I lose. By whatever criteria, I lose horribly.

Thanks to the internet!

So, about a week ago, I posted the video of the evil teddy bear to my blog. I had put it there to show my two readers. Within a day, it had exploded across the internet with 20,000 hits on YouTube!

I think the culprits are the wonderful people from Adafruit (Buy from them!!!). I mentioned where I got the motor controller and I think someone from there posted my video and pictures to:

Make

From there, my favorite gadget blog picked it up. This is where I got the most hits from.

Gizmodo (Hi Giz, you guys rock!)

From there it traveled on to other places in the land of the interwebs:

The Robot Blog


Destructoid

And, last, but not least

gaygamer.net

("For boys who like boys who like joysticks" is there motto. I doubt mine was the only bear on there, if you catch my drift!)

Thanks the Internet!! Lots of great feedback. Surprisingly I only read one negative comment!

Evil Teddy Robot Instructions, part 1

Unfortunately, I didn't document the project at all along the way, so everything here is from memory.

See a couple of posts ago for the big parts you will need.

First, get yourself a BJ Bearytales. Now, you're going to want to field dress the bear carefully. The skin is attached to the body in some key places. I would start with a slit vertically up the abdomen, and then go across the neck. Be careful on the head. The nose and the ears and a few other places are attached to the skull. The tricky part is the back. The backpack is holding on the skin here. What you need to do is take out the backpack screws. The manufacturer thought it would be funny to use these annoying little triangle screws. I was able to get them with a flathead screwdriver; they're not screwed in too tight. (Don't be afraid to have fun mutilating your little friend; he would do the same to you if he got the chance)

OK, now you have the bear stripped. You'll see a yellow wire going down his left arm and around his hand. I wasn't sure what this was at first, so I went ahead and removed it. It turns out to be the antenna to trigger his hand accessories. If you plan to use the accessories, then leave it be.

If I remember correctly, the circuit board should be exposed now. You can unscrew it if you want and pull it off a little. Be sure not to sever any of the wires yet, you are going to want to keep track of which ones are which. I started by removing the skull. There are 7-10 screws holding the skull on, including two on the neck. Take all of these off. The last thing holding on the back of the head is a little spring clip on the neck. Carefully pull this back and remove the back head plate.

You should now see a green gear box. I don't think it is screwed on, but It is attached to the mouth, ears and eyes. I would first, move the ears out of the way (no need to remove them, just unhook them from the gear box). If you look through the eye holes and mouth from the front you should see how they connect to the gear box. Carefully slip these off the hooks using a small screwdriver or other small tool. You should now be able to remove the gear box.

Notice where the wires go on the gear box. Two of them attach near the bottom, and the other three attach near the top on the side. The two bottom wires drive the motor. The top three are for sensing the position of the gears. This is to make sure he doesn't slip a gear and stop mid-blink, horrifying your children with his half-blunk hollow eyes. You can remove the sensor circuit board with a screw-driver, I think. It is interesting to see how its set up. I think the middle wire is either ground or power and the other two are for sensing. I didn't use them for anything, but they would be extremely useful to get feedback from the head. I just didn't have enough pins on the Arduino to do this.

So at this point, I cut the head motor wires about halfway between the gearbox and the circuit board (to leave myself enough room on both sides to re-attach if I needed to). This time you can start to play with the motor using your own power supply. You'll see that if you run it in one direction it will drive the eyes and ears in a periodic cycle. That is, he blinks, he wiggles his ears, blink, wiggle, blink, wiggle, blink, ad infinitum. If you run it the other way he'll quickly run his mouth half-way and then get stuck in a horribly loud clicking lock-jaw position. They key to mouth is you run the engine a little bit one way, and run it a little bit back the other way. If you run it just a little bit it will keep the eyes and ears from blinking. I think it disengages them when you run it one way, and then reengages them when you run the other.

That should be enough for you to play around with now. I'll update more soon, including a picture of the original circuit board with a rough pin-out listing.

Wednesday, July 30, 2008

Source code for evil teddy

#include <Wire.h>
#include <nunchuck_funcs.h>
#include <AFMotor.h>

AF_DCMotor armNeckMotor2(3, MOTOR12_64KHZ);
AF_DCMotor armNeckMotor1(2, MOTOR12_64KHZ);
AF_DCMotor eyesMouthMotor(1, MOTOR12_64KHZ);

int loop_cnt = 0;
float accelx,accely,accelz,joyx,joyy;
byte zbut,cbut;
int speakerPin = 2;
int lightPin = 14;

//These are to detect if buttons are pressed in rapid succession
int sequenceCount1 = 0;
int start1 = false;


void setup() {

Serial.begin(9600);

nunchuck_init_with_power();

eyesMouthMotor.setSpeed(200);
armNeckMotor1.setSpeed(200);
armNeckMotor2.setSpeed(200);

pinMode(speakerPin,OUTPUT);
pinMode(lightPin,OUTPUT);
}

void special()
{

digitalWrite(speakerPin, HIGH);
delay(50);
digitalWrite(speakerPin,LOW);

digitalWrite(lightPin,HIGH);

for (int i = 0; i < 15; i++)
{

eyesMouthMotor.run(BACKWARD);
delay(random(150,250));
eyesMouthMotor.run(FORWARD);
delay(random(75,125));
eyesMouthMotor.run(RELEASE);

}
delay(1000);
digitalWrite(lightPin,LOW);
}

void startTimer()
{
start1 = true;
sequenceCount1 = 0;
}

void stopTimer()
{
start1 = false;
sequenceCount1 = 0;
}


void loop() {
if (loop_cnt>100)
{
if (start1==true)
{
sequenceCount1++;

}

if (sequenceCount1>5)
{
stopTimer();
}

loop_cnt=0;

nunchuck_get_data();

accelx = nunchuck_accelx(); // ranges from approx 70 - 182


accely = nunchuck_accely(); // ranges from approx 65 - 173


accelz = nunchuck_accelz();

// 1 pressed, 0 free
zbut = nunchuck_zbutton();

// 1 pressed, 0 free
cbut = nunchuck_cbutton();

// 23<--125-->227
joyx = nunchuck_joyx();


// 227
// ^
//130
// v
//31
joyy = nunchuck_joyy();

if (cbut)
{
eyesMouthMotor.run(FORWARD);

startTimer();
}
else
{
eyesMouthMotor.run(RELEASE);
}
if (zbut)
{


if (sequenceCount1 > 1 && sequenceCount1 < 5)
{
special();
stopTimer();
}
else
{
eyesMouthMotor.run(BACKWARD);
delay(150);
eyesMouthMotor.run(FORWARD);
}
}

if (joyx>150 || joyx<100)
{

if (joyx>150)
{

armNeckMotor1.run(BACKWARD);

}
else
{
armNeckMotor1.run(RELEASE);
}


if (joyx<100)
{

armNeckMotor2.run(BACKWARD);

}
else
{
armNeckMotor2.run(RELEASE);
}

}
else if (joyy>150)
{


armNeckMotor1.run(BACKWARD);
armNeckMotor2.run(BACKWARD);

}
else if (accelx>160)
{
armNeckMotor1.run(FORWARD);
}
else if (accely>160)
{
armNeckMotor2.run(FORWARD);
}
else
{
armNeckMotor1.run(RELEASE);
armNeckMotor2.run(RELEASE);
}

//Serial.println(accelx,DEC);
//Serial.println(accely,DEC);
// Serial.println(accelz,DEC);
// Serial.println(joyx,DEC);
// Serial.println(joyy,DEC);
// Serial.println(zbut,DEC);
// Serial.println(cbut,DEC);


}
loop_cnt++;
delay(1);
}

Tuesday, July 29, 2008

It speaks!



I'll post as many details of the process as I can in the next few days. First, the list of parts (not including wiring, solder, etc...):

Arduino Diecimila
Adafruit Motor Shield
Wiichuck adapter
BJ Bearytales (Also available in the 9th circle of hell if Toy's R Us is out)
Wiichuck
Voice Recording Module

And other assorted accessories...