Inspiration
Eric wanted a noisemaker, so we built him one!
What it does
It plays sounds generated by single C statements and RFID cards pick which sound plays.
How we built it
For hardware, we used a Teensy 3.2 and an Adafruit PN532 RFID Shield. The Teensy has a built-in 12-bit DAC that we are using for sound output. It feeds a resistor divider to reduce the output to a lower level and a couple capacitors for filtering.
The C statements for generating sound were found on this blog post. Eric spent a lot of time experimenting with different statements using this online tool. He figured out what statements didnt work well together so we could split them up in the code. The code was built off of one of the examples provided with the RFID shield library. It waits for a card to be detected and reads the UID which is unique to each card. No data can be read from cards with encryption because authentication must be done before read access is granted by the controller IC.
Two values are generated for picking sound functions from an array. Each byte of the card's UID is split into two nibbles. One value is generated using the even-numbered nibbles and the other is generated using the odd nibbles. A modulus is done to get the sum in range of our array sizes.
Finally the sound is generated by feeding a counter into the sound functions that were picked and their output is sent to the DAC on the Teensy.
Challenges we ran into
Many sound-generating statements would produce garbage when combined. We also spent a while coming up with a way to pick statements that was based on a card's UID but seemed random for cards with similar UIDs.
Accomplishments that we're proud of
Eric listened to sooooo many sound samples. Literally all of them.
What we learned
Simple statements like (t&t>>8) produce cool, fractal-like patterns.
What's next for wonderhack
Who knows? Maybe building a spectrum analyzer with lots of LEDs.
Log in or sign up for Devpost to join the conversation.