My mini project of using a wind sensor to play audio files has started moving after days of confusion. I was just looking in the wrong places for information. The codes I started with from ladyada's waveshield pages weren't working ( https://learn.adafruit.com/adafruit-wave-shield-audio-shield-for-arduino/play6-hc and https://cdn-learn.adafruit.com/assets/assets/000/010/334/original/daphc.pde.txt).
Well, the second one worked at least, but it took a long time to cycle back to the audio file on my SD card.
Oh, and a note on the SD card: Your wave file has to be formated to 22khz, 16bit, and mono. I did this by uploading the track to itunes after making these the itunes upload settings in preferences. Your file name should also be in ALL CAPS, like ALERT.WAV (and .wav is just the extension, not part of the file name. Right click --> get info to see if this is what your audio file is like.
I downloaded the WaveHC library and dragged the folder from within its zipfile into the Libraries folder within the Arduino system folder. I eventually realized that this gave me some new premade sketches in arduino's sketch library. The one I am using now is called 'daphc'.
I hooked up a wind sensor to A0, as well as 5v and gnd. I inserted some bits of code within the daphc file to make it play my audio file in response to sensorValue. You can see these additions by the //sensor notes.
Next goals:
1. Stop file play back when sensor value falls.
2. Write and record spoken word file.
3. Create enclosure
Saturday, November 12, 2016
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment