-
1Step 1
Separate a single cat from the rest of the board. You can use a rotary tool, a scroll saw, a hand saw or a file. For best effect, round off the edges.
-
2Step 2
If it's a cat with holes for the eyes, you need to get rid of the metallic layer inside the holes. Cut it with a knife until there is no electrical connection between the pads of the LED.
-
3Step 3
Solder all the parts onto the board. Also solder an additional wire for the reset.
Pay attention to the polarization of the LEDs.
-
4Step 4
Connect your programmer. I use USBASP, but there is a number of different programmers that you can use, including an Arduino.
-
5Step 5
Follow this tutorial to setup your Arduino IDE. You may need to run it as root. Use this arduino core: https://code.google.com/p/arduino-tiny/
-
6Step 6
Upload the following code:
const int BEEP_PIN = 4; const int LED_PIN = 3; const int LENGTH = 27; const int NOTES[] = { 65, 67, 70, 67, 74, 74, 72, 65, 67, 70, 67, 72, 72, 70, 69, 67, 65, 67, 70, 67, 70, 72, 69, 65, 65, 72, 70 }; const float DURATIONS[] = { 0.25, 0.25, 0.25, 0.25, 0.75, 0.75, 1.5, 0.25, 0.25, 0.25, 0.25, 0.75, 0.75, 0.75, 0.25, 0.5, 0.25, 0.25, 0.25, 0.25, 1.0, 0.5, 0.75, 0.25, 1.0, 0.5, 1.0, 2.0 }; const int BPM = 120; void play(const int notes[], const float durations[], int bpm, int length) { float bps = (60.0 / BPM) * 1000.0; for (int i = 0; i < length; ++i) { int hertz = (int) (pow(2.0, ((notes[i] - 69.0) / 12.0)) * 440); tone(BEEP_PIN, hertz, (long) (durations[i] * bps) - 10); delay((long) (durations[i] * bps)); toggle_eyes(); } } void toggle_eyes() { static bool blink = false; digitalWrite(LED_PIN, blink); blink = !blink; } void setup() { pinMode(BEEP_PIN, OUTPUT); pinMode(LED_PIN, OUTPUT); } void loop() { play(NOTES, DURATIONS, BPM, LENGTH); }
-
7Step 7
Disconnect the programmer, and connect a power source (from 3V to 5V) to the brown (minus) and red (plus) wires. You should hear music and the eyes should blink. Congratulations.
You can now glue the speaker to the back of the cat, and it's finished.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
some how the tone function isnt working for me. so far the LEDs are blinking :)
Are you sure? yes | no
Did you use the arduino core that I linked to in step 5? I couldn't get it to work with the core from the tutorial.
Are you sure? yes | no
Hi Radomir,
Do you happen to have the binary for me? I'm having issues with the compilation here.... :/
Are you sure? yes | no
I wouldn't even know where to find or how to use a binary from the Arduino IDE... What is the problem exactly?
Are you sure? yes | no