• Yes, the Sparkfun board would definitely be easier!

    But to get started with the Adafruit one, use the first example on the File IO page linked above:

    // Wire up up MOSI, MISO, SCK and CS pins (along with 3.3v and GND)
    SPI1.setup({mosi:B5, miso:B4, sck:B3});
    E.connectSDCard(SPI1, B6 /*CS*/);
    // see what's on the device
    console.log(require("fs").readdirSync());
    

    (and try wiring the SD card as shown above)

    For the Sparkfun board their code is a good start: https://github.com/sparkfun/Audio-Sound_Breakout-WTV020SD/blob/V_1.0/firmware/Audio-Sound_Breakout/AudioModule.ino

    Just replace sendCommand with something like:

    function sendCommand(command) {
      digitalWrite(DCLK, 0);
      setTimeout(function() {
        for (var i = 0; i < 16; i++) {
          digitalWrite(DCLK, 0);
          digitalWrite(DOUT, (command & 0x8000) != 0);
          digitalWrite(DCLK, 1);
          command = command<<1;
        }
      },2);
    }
    

    Also, you know that Espruino can do sounds itself? http://www.espruino.com/Waveform

    It may not be significantly worse quality than the Sparkfun board :)

About

Avatar for Gordon @Gordon started