Last active
August 29, 2015 14:00
-
-
Save buildcircuit/d5fe608c5c236684822e to your computer and use it in GitHub Desktop.
WTV020SD-16P evaluation board test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Example: Control a WTV020-SD-16P evaluation board to play voices using WTV020SD-16P | |
module. | |
www.buildcircuit.com | |
Released into the public domain. | |
*/ | |
#include <Wtv020sd16p.h> | |
int resetPin = 2; // The pin number of the reset pin. | |
//Connect to RST pin of evaluation board. This connects to Pin 1 in wtv020sd-16P module. | |
int clockPin = 3; // The pin number of the clock pin. | |
//Connect to P04 pin of evaluation board. This connects to Pin 7 in wtv020sd-16P module | |
int dataPin = 4; // The pin number of the data pin. | |
//Connect to P05 pin of evaluation board. This connects to Pin 10 in wtv020sd-16P module. | |
int busyPin = 5; // The pin number of the busy pin. | |
//Connect to P06 pin of evaluation board. This connects to Pin 15 in wtv020sd-16P module. | |
/* | |
Create an instance of the Wtv020sd16p class. | |
1st parameter: Reset pin number. | |
2nd parameter: Clock pin number. | |
3rd parameter: Data pin number. | |
4th parameter: Busy pin number. | |
*/ | |
Wtv020sd16p wtv020sd16p(resetPin,clockPin,dataPin,busyPin); | |
void setup() { | |
//Initializes the module. | |
wtv020sd16p.reset(); | |
} | |
void loop() { | |
wtv020sd16p.asyncPlayVoice(0); // plays song 0, 0000.AD4 | |
delay(8000); // play time duration | |
wtv020sd16p.stopVoice(); | |
wtv020sd16p.asyncPlayVoice(1); // plays song 1, 0001.ad4 | |
delay(8000); // play time duration | |
wtv020sd16p.stopVoice(); | |
wtv020sd16p.asyncPlayVoice(2); // plays song 2, 0002.ad4 | |
delay(8000); // play time duration | |
wtv020sd16p.stopVoice(); | |
wtv020sd16p.asyncPlayVoice(3); // plays song 2, 0003.ad4 | |
delay(8000); // play time duration | |
wtv020sd16p.stopVoice(); | |
// you can add more songs likewise | |
} | |
//- See more at: http://www.buildcircuit.com/example-1-using-wtv020sd-16p-music-module-with-arduino/#sthash.v2lPgRtU.dpuf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment