|
- #include <Audio.h>
- #include <Wire.h>
- #include <SPI.h>
- #include <SD.h>
- #include <SerialFlash.h>
-
- AudioPlaySdWav playWav1;
- AudioOutputUSB audioOutput;
- AudioOutputAnalog dac;
- AudioConnection patchCord1(playWav1, 0, audioOutput, 0);
- AudioConnection patchCord2(playWav1, 1, audioOutput, 1);
- AudioConnection patchCord3(playWav1, 0, dac, 0);
-
-
- #define SDCARD_CS_PIN 10
- #define SDCARD_MOSI_PIN 7
- #define SDCARD_SCK_PIN 14
-
-
-
-
-
-
-
-
-
-
-
- void setup() {
- Serial.begin(9600);
-
-
-
- AudioMemory(20);
-
- SPI.setMOSI(SDCARD_MOSI_PIN);
- SPI.setSCK(SDCARD_SCK_PIN);
- if (!(SD.begin(SDCARD_CS_PIN))) {
-
- while (1) {
- Serial.println("Unable to access the SD card");
- delay(500);
- }
- }
- }
-
- void playFile(const char *filename)
- {
- playWav1.play(filename);
-
- delay(5);
-
- while (playWav1.isPlaying()) {
- }
- }
-
- void loop() {
- playFile("SDTEST1.WAV");
- delay(500);
- playFile("SDTEST2.WAV");
- delay(500);
- playFile("SDTEST3.WAV");
- delay(500);
- playFile("SDTEST4.WAV");
- delay(1500);
- }
-
-
-
-
-
-
|