Go Down

Topic: Help needed in programming my Arduino uno to communicate with sparkfun mp3 trigg (Read 1 time) previous topic - next topic

Jamiedrummer

Hi

I have been trying to get my sparkfun mp3 trigger to communicate with my Arduino uno. I basically want to connect a drum trigger to the Arduino and when an input is given to it have that communicate over serial to the mp3 trigger board to play a sample on the SD card. Unfortunately i have very little programming experience and have reached a wall. I am aware that an Arduino is not needed and that i can connect the trigger straight to the mp3 trigger board but i want to be able to play the same sample over its self, is this even possible ?

I have been using this guide and have ended up with the code in example 3, thinking its the best suited to what i need but it is not communicating with the mp3 trigger when an input is given.

http://interaction.dundee.ac.uk/~ali/blog/using-the-sparkfunrobertsonics-mp3-trigger-module-with-arduino/

any help will be appreciated.

Thanks
Jamie

PaulS

Post the code that is running on YOUR Arduino.

Quote
I basically want to connect a drum trigger to the Arduino

Have you done this? What is connected, where?

Quote
and when an input is given to it

Inputs aren't given. They are read. Are you reading anything from the drum trigger?

Quote
have that communicate over serial to the mp3 trigger board to play a sample on the SD card.

What is "that"? What are you sending to the serial port? Is the mp3 trigger board (link?) connected to the serial port?

Jamiedrummer

Hi

thanks for the reply, sorry my previous post wasnt very clear.

This is the code i am using at the moment.

Code: [Select]
#include <MP3Trigger.h>
MP3Trigger trigger;
int input = 0;
int value = 0;
void setup()
{
//start serial communication with the trigger (over Serial)
trigger.setup();

}

void loop()
{
  value = analogRead(input);
  if (value >0 && value <340)
  {
    trigger.trigger(1);
  }
  else
  if (value > 340 && value <680)
  {
    trigger.trigger(2);
  }
  else
  {
    trigger.trigger(3);
  }

}





the trigger is an analogue transducer and i have been trying to connect it to analogue input 1 on the arduino

i am currently reading nothing from the trigger.

and the mp3 trigger board is connect to the arduino over serial i want it to send information to allow the sample multilayered.

Thanks

PaulS

Code: [Select]
  value = analogRead(input);
  if (value >0 && value <340)
  {
    trigger.trigger(1);
  }

The value read from the pin can not be less than 0, so the first part of the compound if test excludes only excludes the value 0.

Code: [Select]
  if (value > 340 && value <680)
Interesting. What happens if the value IS 340?

Quote
the trigger is an analogue transducer and i have been trying to connect it to analogue input 1 on the arduino

i am currently reading nothing from the trigger.

Help on generic stuff is hard to come by. A link to the specific transducer you have in your hot little hands (or on the test bench) would go a long way towards getting you real help.

Go Up