Lilypad MP3: avrdude: stk500_recv(): programmer is not responding

Hello (i am an absolute beginner)

I am trying to start up my Lilypad MP3 using the ready-made program ‘Trigger’.
It didn’t work (could hear the files, SD card and file names are good) so I uploaded it again and it returns this error:

avrdude: stk500_recv(): programmer is not responding

Settings:
Board: “ArduinoMini”
Processor: “ATmega328P”
Port: usb serial
Programmer: currently set on Arduino ISP
Upload:(commandeU)

Thank you in advance for your help!

// "Trigger" example sketch for Lilypad MP3 Player
// Mike Grusin, SparkFun Electronics
// http://www.sparkfun.com

// This sketch (which is preloaded onto the board by default),
// will play a specific audio file when one of the five trigger
// inputs (labeled T1 - T5) is momentarily grounded.


// Revision history:
// 1.0 initial release MDG 2012/11/01


// We'll need a few libraries to access all this hardware!

#include <SPI.h>            // To talk to the SD card and MP3 chip
#include <SdFat.h>          // SD card file system
#include <SFEMP3Shield.h>   // MP3 decoder chip



const int TRIG1 = A0;
const int TRIG2 = A4;
const int TRIG3 = A5;
const int TRIG4 = 1;
const int TRIG5 = 0;
int trigger[5] = {TRIG1,TRIG2,TRIG3,TRIG4,TRIG5};



const int ROT_LEDR = 10; // Red LED in rotary encoder (optional)
const int EN_GPIO1 = A2; // Amp enable + MIDI/MP3 mode select
const int SD_CS = 9;     // Chip Select for SD card



SFEMP3Shield MP3player;
SdFat sd;

// Set debugging = true if you'd like status messages sent 
// to the serial port. Note that this will take over trigger
// inputs 4 and 5. (You can leave triggers connected to 4 and 5
// and still use the serial port, as long as you're careful to
// NOT ground the triggers while you're using the serial port).

boolean debugging = false;


boolean interrupt = true;


boolean interruptself = false;



char filename[5][13];


void setup()
{
  int x, index;
  SdFile file;
  byte result;
  char tempfilename[13];


  for (x = 0; x <= 4; x++)
  {
    pinMode(trigger[x],INPUT);
    digitalWrite(trigger[x],HIGH);
  }

  
  pinMode(ROT_LEDR,OUTPUT);
  digitalWrite(ROT_LEDR,HIGH);  // HIGH = off

  pinMode(EN_GPIO1,OUTPUT);
  digitalWrite(EN_GPIO1,LOW);  // MP3 mode / amp off


  
  if (debugging)
  {
    Serial.begin(9600);
    Serial.println(F("Lilypad MP3 Player trigger sketch"));
  }
  

  if (debugging) Serial.print(F("initialize SD card... "));

  result = sd.begin(SD_CS, SPI_HALF_SPEED); // 1 for success
  
  if (result != 1) // Problem initializing the SD card
  {
    if (debugging) Serial.print(F("error, halting"));
    errorBlink(1); // Halt forever, blink LED if present.
  }
  else
    if (debugging) Serial.println(F("success!"));
  
  // Start up the MP3 library

  if (debugging) Serial.print(F("initialize MP3 chip... "));

  result = MP3player.begin(); // 0 or 6 for success

  // Check the result, see the library readme for error codes.

  if ((result != 0) && (result != 6)) // Problem starting up
  {
    if (debugging)
    {
      Serial.print(F("error code "));
      Serial.print(result);
      Serial.print(F(", halting."));
    }
    errorBlink(result); // Halt forever, blink red LED if present.
  }
  else
    if (debugging) Serial.println(F("success!"));

  // Now we'll access the SD card to look for any (audio) files
  // starting with the characters '1' to '5':

  if (debugging) Serial.println(F("reading root directory"));

  // Start at the first file in root and step through all of them:

  sd.chdir("/",true);
  while (file.openNext(sd.vwd(),O_READ))
  {
    // get filename

    file.getFilename(tempfilename);

    // Does the filename start with char '1' through '5'?      

    if (tempfilename[0] >= '1' && tempfilename[0] <= '5')
    {
      // Yes! subtract char '1' to get an index of 0 through 4.

      index = tempfilename[0] - '1';
      
      // Copy the data to our filename array.

      strcpy(filename[index],tempfilename);
  
      if (debugging) // Print out file number and name
      {
        Serial.print(F("found a file with a leading "));
        Serial.print(index+1);
        Serial.print(F(": "));
        Serial.println(filename[index]);
      }
    }
    else
      if (debugging)
      {
        Serial.print(F("found a file w/o a leading number: "));
        Serial.println(tempfilename);
      }
      
    file.close();
  }

  if (debugging)
    Serial.println(F("done reading root directory"));
  
  if (debugging) // List all the files we saved:
  {
    for(x = 0; x <= 4; x++)
    {
      Serial.print(F("trigger "));
      Serial.print(x+1);
      Serial.print(F(": "));
      Serial.println(filename[x]);
    }
  }


  MP3player.setVolume(10,10);
  

  digitalWrite(EN_GPIO1,HIGH);
  delay(2);
}


void loop()
{
  int t;              // current trigger
  static int last_t;  // previous (playing) trigger
  int x;
  byte result;
  


  for(t = 1; t <= (debugging ? 3 : 5); t++)
  {

    if (digitalRead(trigger[t-1]) == LOW)
    {

      
      x = 0;
      while(x < 50)
      {
        if (digitalRead(trigger[t-1]) == HIGH)
          x++;
        else
          x = 0;
        delay(1);
      } 
        
      if (debugging)
      {
        Serial.print(F("got trigger "));
        Serial.println(t);
      }


      if (filename[t-1][0] == 0)
      {
        if (debugging)
          Serial.println(F("no file with that number"));
      }
      else // We do have a filename for this trigger!
      {

        if (interrupt && MP3player.isPlaying() && ((t != last_t) || interruptself))
        {
          if (debugging)
            Serial.println(F("stopping playback"));

          MP3player.stopTrack();
        }

 

        result = MP3player.playMP3(filename[t-1]);

        if (result == 0) last_t = t;  // Save playing trigger
  
        if(debugging)
        {
          if(result != 0)
          {
            Serial.print(F("error "));
            Serial.print(result);
            Serial.print(F(" when trying to play track "));
          }
          else
          {
            Serial.print(F("playing "));
          }
          Serial.println(filename[t-1]);
        }
      }
    }
  }
}


void errorBlink(int blinks)
{


  int x;

  while(true) // Loop forever
  {
    for (x=0; x < blinks; x++) // Blink the given number of times
    {
      digitalWrite(ROT_LEDR,LOW); // Turn LED ON
      delay(250);
      digitalWrite(ROT_LEDR,HIGH); // Turn LED OFF
      delay(250);
    }
    delay(1500); // Longer pause between blink-groups
  }
}

(deleted)

Hi thanks for your answer

No with Lilypad USB I get this error:
avrdude: butterfly_recv(): programmer is not responding

I just got it to work now with "Arduino Pro or Arduino Mini" (no more error on upload)

But i still can't hear any sound files on trigger ...

(deleted)

Hello
Thanks for your reply.

I wired it like this (see link), except I have T1 and T2 only and earphones in the jack:

https://learn.sparkfun.com/tutorials/getting-started-with-the-lilypad-mp3-player?_ga=2.246855044.1212317419.1515763396-543004274.1511718659#getting-started-with-the-default-trigger-sketch

I am connected to USB via breakout 5V, switch is on, SD card inserted correctly, battery full connected also.

Port: dev/cu.usbserial/AH03FM98

My output is the headphone jack for the moment: I should be able to hear the sound as is. Here is what is said about the output in the specs:

Problems with the speakers:

  • Plug in headphones and see if you can hear any sound that way.
  • Note that when you plug in headphones, the speakers will be disabled.
  • Try using alligator cables to connect directly from the LilyPad MP3 Player to your speakers.
  • If you’re writing your own code, ensure you don’t have the amplifier disabled using the shutdown signal (EN_GPIO1, which is on A2). This signal should be HIGH to activate the amplifier.
  • Note that this amplifier chip has a feature that slowly ramps up the volume when it’s first turned on.

Thanks again. It's supposed to be plug and play, i haven't touched the code yet..

Hello Paul Thanks again for your help

I tried the debug already but I couldn’t see a line printed on the monitor.
Just fixed it by changing Serial.begin to 115200: works!

Error at the very start:

Lilypad MP3 Player trigger sketch
initialize SD card… error, halting

I reformated my SD card, re-checked my sound files, the inserted SD etc

One thing I find strange is in the libraries: “SPI” is displayed red, not black.

#include <SPI.h> // To talk to the SD card and MP3 chip

Could that be the problem?
If yes what does that mean?

In my library manager it says SPI.h is installed.

I am puzzled. (but making progress…)