I have purchased and assembled a Wave Shield so I can play audio on my arduino. Excuse my ignorance but I'm new to this and i'm struggling to make sense of the code.
I tried using this: http://www.ladyada.net/make/waveshield/libraryhc.html but when i'm clicking verify, it comes up with errors. I'm unsure whether I've set up my libraries properly but I have tried a couple of different things. If someone could run me through what I need to do I would be very grateful!
I have set my SD card to FAT and I have put 5 WAV files on it ready to play.
Thanks in advance
My aim is for one of the WAV files to play every time the arduino senses light. I'm guessing that would help you help me!
Wave Shield Code
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88153
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield Code
First, have you installed the WaveHC library correctly? http://www.ladyada.net/library/arduino/libraries.html
If you still have problems compiling, post the error messages you are getting so we can help diagnose the problem.
If you still have problems compiling, post the error messages you are getting so we can help diagnose the problem.
-
- Posts: 4
- Joined: Wed Apr 25, 2012 1:28 pm
Re: Wave Shield Code
Is there a specific way I should be making a library on a Mac? I've gone Documents>Arduino then i have made a folder named 'libraries' and draggd and dropped the downloaded files into that folder.
The error in white writing with orange backing reads "variable or field 'play' declared void
The error in white writing with orange backing reads "variable or field 'play' declared void
- adafruit_support_bill
- Posts: 88153
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield Code
Is that the complete text of the error message(s)? There are often more than one and the first one is typically the most relevant. Scroll up in the output window to make sure you get all of them.
-
- Posts: 4
- Joined: Wed Apr 25, 2012 1:28 pm
Re: Wave Shield Code
daphc.cpp:4:20: error: WaveHC.h: No such file or directory
daphc.cpp:5:22: error: WaveUtil.h: No such file or directory
daphc.pde error: variable or field 'play' declared void
daphc.pde error: 'FatReader' was not declared in this scope
daphc.pde error: 'dir' was not declared in this scope
daphc.pde error: 'SdReader' does not name a type
daphc.pde error: 'FatVolume' does not name a type
daphc.pde error: 'FatReader' does not name a type
daphc.pde error: 'WaveHC' does not name a type
daphc.pde error: 'dir_t' does not name a type
daphc.pde error: variable or field 'play' declared void
daphc.pde error: 'FatReader' was not declared in this scope
daphc.pde error: 'dir' was not declared in this scope
daphc.cpp: In function 'void setup()':
daphc.pde error: 'putstring_nl' was not declared in this scope
daphc.pde error: 'putstring' was not declared in this scope
daphc.pde error: 'FreeRam' was not declared in this scope
daphc.pde error: 'card' was not declared in this scope
daphc.pde error: 'card' was not declared in this scope
daphc.pde error: 'vol' was not declared in this scope
daphc.pde error: 'vol' was not declared in this scope
daphc.pde error: 'root' was not declared in this scope
daphc.pde error: 'root' was not declared in this scope
daphc.pde error: 'LS_R' was not declared in this scope
daphc.pde error: 'LS_FLAG_FRAGMENTED' was not declared in this scope
daphc.cpp: In function 'void loop()':
daphc.pde error: 'root' was not declared in this scope
daphc.pde error: 'play' was not declared in this scope
daphc.cpp: In function 'void error_P(const char*)':
daphc.pde error: 'PgmPrint' was not declared in this scope
daphc.pde error: 'SerialPrint_P' was not declared in this scope
daphc.cpp: In function 'void sdErrorCheck()':
daphc.pde error: 'card' was not declared in this scope
daphc.pde error: 'PgmPrint' was not declared in this scope
daphc.pde error: 'card' was not declared in this scope
daphc.cpp: At global scope:
daphc.pde error: variable or field 'play' declared void
daphc.pde error: 'FatReader' was not declared in this scope
daphc.pde error: 'dir' was not declared in this scope
daphc.cpp:5:22: error: WaveUtil.h: No such file or directory
daphc.pde error: variable or field 'play' declared void
daphc.pde error: 'FatReader' was not declared in this scope
daphc.pde error: 'dir' was not declared in this scope
daphc.pde error: 'SdReader' does not name a type
daphc.pde error: 'FatVolume' does not name a type
daphc.pde error: 'FatReader' does not name a type
daphc.pde error: 'WaveHC' does not name a type
daphc.pde error: 'dir_t' does not name a type
daphc.pde error: variable or field 'play' declared void
daphc.pde error: 'FatReader' was not declared in this scope
daphc.pde error: 'dir' was not declared in this scope
daphc.cpp: In function 'void setup()':
daphc.pde error: 'putstring_nl' was not declared in this scope
daphc.pde error: 'putstring' was not declared in this scope
daphc.pde error: 'FreeRam' was not declared in this scope
daphc.pde error: 'card' was not declared in this scope
daphc.pde error: 'card' was not declared in this scope
daphc.pde error: 'vol' was not declared in this scope
daphc.pde error: 'vol' was not declared in this scope
daphc.pde error: 'root' was not declared in this scope
daphc.pde error: 'root' was not declared in this scope
daphc.pde error: 'LS_R' was not declared in this scope
daphc.pde error: 'LS_FLAG_FRAGMENTED' was not declared in this scope
daphc.cpp: In function 'void loop()':
daphc.pde error: 'root' was not declared in this scope
daphc.pde error: 'play' was not declared in this scope
daphc.cpp: In function 'void error_P(const char*)':
daphc.pde error: 'PgmPrint' was not declared in this scope
daphc.pde error: 'SerialPrint_P' was not declared in this scope
daphc.cpp: In function 'void sdErrorCheck()':
daphc.pde error: 'card' was not declared in this scope
daphc.pde error: 'PgmPrint' was not declared in this scope
daphc.pde error: 'card' was not declared in this scope
daphc.cpp: At global scope:
daphc.pde error: variable or field 'play' declared void
daphc.pde error: 'FatReader' was not declared in this scope
daphc.pde error: 'dir' was not declared in this scope
- adafruit_support_bill
- Posts: 88153
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield Code
That means it is not finding your library. One problem with the IDE is that it will not detect libraries that are installed after it starts running. Just starting a new instance of the IDE isn't good enough. Make sure that you exit ALL instances of the IDE, then re-start after installing the library.daphc.cpp:4:20: error: WaveHC.h: No such file or directory
daphc.cpp:5:22: error: WaveUtil.h: No such file or directory
-
- Posts: 4
- Joined: Wed Apr 25, 2012 1:28 pm
Re: Wave Shield Code
Thankyou... what it was, was that when i was putting the file into the library i was putting the folder with the files in. Once i copied the files out of the folder and straight into libraries it worked. My only problem now is that i've uploaded it but it isn't playing any sound!!
- adafruit_support_bill
- Posts: 88153
- Joined: Sat Feb 07, 2009 10:11 am
Re: Wave Shield Code
Post photos of the front & back of the board and we'll look over your assembly. Also post the output from the Serial Monitor when you run the sketch.
Please be positive and constructive with your questions and comments.