Jamie and I are pleased because we were finally able to see our collaborative project through to near completion. Of course there were some glitches (we burned out 2 light bulbs so they weren't working when we did the demo) and I need more practice writing code so that I don't feel like I'm flying blind.
Technical details:
This is the code I used to test the switches by using the serial monitor to read a high or low signal. Pulled from Ladyada's Tutorial #5:
switch_test.pde
This is the code I used to test the relays to make sure they were wired correctly. Set the pin number that the relay is connected to and it will turn it on for 10 seconds upon reset.
relay_test.pde
And this is the diagram that I used (mostly) for wiring the relays:
relay.pdf
But the information on this website helped with the wiring also:
Relay
This is the final code that we used in the presentation:
collab_audioandrelay_final.pde
Most of the Waveshield code was pulled from examples that Ladyada had posted here:
Use Waveshield
Using the example to play once through but allow other buttons to interrupt, we were able to add on code from the switch tutorials for the relays.
A (mostly) accurate wiring diagram was posted on our project update post a while ago, so I'll skip that here. But here are the images of the wiring setups. We had two breadboards: one hooked up to switches and the analog pins on the waveshield, the other for transistors and going to the relays through the digital pins.

Leave a comment