This isn't working for me. I have a Arduino Micro and Adafruit VS1053 breakout board with SD card.
VCC - ICSP 5V
GND - ICSP GND
SCLK - ICSP SCK
MISO - ICSP MISO
MOSI - ICSP MOSI
RST - Pin 9 (D9)
CS - Pin 10 (D10)
XCDS - Pin 8 (D8)
SDCS - Pin 6 (D6)
DREQ - RX (Pin D0, INT2)
I think I have the ICSP pins wrong. Is the correct layout like this:
3 2 1 (where pin 1 is at the dot on the PC board, and closest to the Micro edge and away from the Micro reset button)
4 5 6
1 = MISO
5 = MOSI
6 = 5V
4 = GND
2 = SCK = VS105 SCLK pin
3 = RESET
Here is my sketch:
#include <SPI.h>
#include <SD.h>
#include <Adafruit_VS1053.h>
void setup() {
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
}
#define CLK 9 // SPI Clock, shared with SD card
#define MISO 11 // Input data, from VS1053/SD card
#define MOSI 10 // Output data, to VS1053/SD card
#define RESET 13 // VS1053 reset pin (output)
#define CS 10 // VS1053 chip select pin (output)
#define DCS 8 // VS1053 Data/command select pin (output)
#define DREQ 0 // VS1053 Data request pin (into Arduino)
#define CARDCS 6 // Card chip select pin
Adafruit_VS1053_FilePlayer musicPlayer = Adafruit_VS1053_FilePlayer(MOSI, MISO, CLK, RESET, CS, DCS, DREQ, CARDCS);
int firsttime = 1;
void loop() {
if (firsttime==1){
firsttime=0;
}
// disable the card (we won't be using it)
pinMode(CARDCS, OUTPUT);
digitalWrite(CARDCS, HIGH);
// initialise the music player
if (!musicPlayer.begin()) {
Serial.println("VS1053 not found");
}
// put your main code here, to run repeatedly:
for (int i=0; i<10; i++){
Serial.println( i );
}
delay(1000);
}
The musicPlayer.begin fails and I see "VS1053 not found".
Help, please. I'd really like to get this working.
-Frank