- Tue Jul 07, 2015 7:05 pm
#183227
Hi everyone,
I just got the Mp3 trigger but the lack of example code out there is giving me fits. I am using this library in an attempt to try and simplify the commands: https://github.com/sansumbrella/MP3Trigger-for-Arduino. However, it doesn't have any worhwhile example code either. All i'm trying to do is use the serial connection to trigger some mp3s in my code. I get about one or two of my mp3s play at almost the right time, and then when I'm fading a strip of LEDs it plays the mp3s as the led commands are written. I'm using the serial monitor for trouble shooting the lighting.
I've tried other bits of example code by themselves and can't make them work either.
I just got the Mp3 trigger but the lack of example code out there is giving me fits. I am using this library in an attempt to try and simplify the commands: https://github.com/sansumbrella/MP3Trigger-for-Arduino. However, it doesn't have any worhwhile example code either. All i'm trying to do is use the serial connection to trigger some mp3s in my code. I get about one or two of my mp3s play at almost the right time, and then when I'm fading a strip of LEDs it plays the mp3s as the led commands are written. I'm using the serial monitor for trouble shooting the lighting.
Code: Select all
#include <Adafruit_NeoPixel.h>
#include <avr/power.h>
#include <FastLED.h>
#include <MP3Trigger.h>
#define PIN 6
#define NUM_LEDS 44
CRGB leds[NUM_LEDS];
MP3Trigger trigger;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
trigger.setup(&Serial);
Serial.begin( MP3Trigger::serialRate() );
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
Code: Select all
In case it isn't obvious I'm a novice at this sort of thing. colorWipe2(strip.Color(32, 0, 128), 500); // blue
delay (1000);
trigger.play(1);
trigger.update();
Serial.println("track001");
delay (500);
//switch (random(1, 3)) {
//switch (3) {
I've tried other bits of example code by themselves and can't make them work either.