I woke up today and decided to do some neurosurgery. I set off into the town and sought out a willing test subject - ladies and gentlemen, meet Chuggzilla (credit goes to Miriam for the name):
Chuggzilla is a keychain monkey I bought in Tiger for around 90 Kč. Pressing a little button on the back of his head causes his LED eyes to light up and a little speaker inside to play a monkey noise:
This is what he looks like on the inside
I soldered a couple of wires to either side of the button element, so that I could control him electronically:
Testing him out with a button on a breadboard
Finally being controlled (via a transistor) by an output pin on the Arduino using the morse code program I previously wrote - the message is "hello world" or ".... . .-.. .-.. --- / .-- --- .-. .-.. -.."
The circuit driving this is below. I used a little LED for debugging when I was checking Chuggzilla was connected fine, and just kept it in the circuit - you can omit it if you're certain your animal is wired up fine :)
The code behind this is at https://github.com/smcl/arduino_morse - it's straight C, so if you want to load it to your Arduino you'll need to have the AVR GCC tools installed, and change the AVRDUDE_PROGRAMMING_DEVICE variable in the Makefile, then run make flash.