Show Posts
Pages: [1] 2
1  Using Arduino / Project Guidance / Re: PIR sensor MP3 shield on: November 24, 2012, 05:34:45 am
All tutorial I've read states that the track should be named track000.mp3-tracknnn.mp3
The mp3 shield is from sparkfun electronics MP3 shield
https://www.sparkfun.com/products/10628
2  Using Arduino / Project Guidance / Re: PIR sensor MP3 shield on: November 23, 2012, 06:08:11 am
I only uploaded one track to tr SD card to test it out first,I've made the changes in te code ran track from 55 to 1 and I named it track001.mp3
3  Using Arduino / Project Guidance / Re: PIR sensor MP3 shield on: November 22, 2012, 09:34:25 pm
I've set the volume and everything,I've changed the chip select from 10 to 9,and the code uploads fine but it cannot ply.!!
4  Using Arduino / Project Guidance / Re: PIR sensor MP3 shield on: November 22, 2012, 03:34:42 am
The code compiler successfully but there is no sound playing!how long must I w8 for the sensor to calibrate itself?
5  Using Arduino / Project Guidance / Re: PIR sensor MP3 shield on: November 17, 2012, 02:20:09 am
ive downloaded the SDFIle,but when i extract everything i cant find the Sd2PinMap.h file??
6  Using Arduino / Project Guidance / Re: PIR sensor MP3 shield on: November 16, 2012, 10:07:20 pm
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SPI.h>
#include <SFEMP3Shield.h>
 SFEMP3Shield MP3player;

 
// constant variables 
     
    int pirPin = 5;                    // PIR sensor input pin
    int calibrationTime = 10;   
    unsigned long playTime = 15000;      // how long a file will play in milliseconds (15000=15 seconds)
    unsigned long pauseTime = 10000;     // how long the pause will be after the sound ends (10000=10 seconds)
    int readingInterval = 20;            // how often to read the sensor
 
   
// changing variables 
 

    int rantrack = 0;                    // track number for randomizing
    unsigned long currentMillis = 0;     // time variable to track running time: current time
    unsigned long startingMillis = 0;    // time variable to track running time: starting time
    byte result;                         // variable for mp3 player shield, can be used to debug
       
// setup     
     
    void setup() {
  pinMode(pirPin, INPUT);
  digitalWrite(pirPin, LOW);

  //give the sensor some time to calibrate
    for(int i = 0; i < calibrationTime; i++){
      delay(1000);
      }
    delay(50);

     pinMode(pirPin, INPUT);                        // make PIR sensor an input
      digitalWrite(pirPin, LOW);                    // activate internal pull-up resistor
      result = MP3player.begin();                      // start mp3 player shield
      MP3player.SetVolume(10, 10);                     // set volume of the mp3 player ( 0 = loudest )
    }
// loop
     
    void loop(){
      if (digitalRead(pirPin)== HIGH) {                // if movement sensed
          randomSeed(millis());                        // set a more random seed for the random function
          rantrack = random(55);                       // find random number
          result = MP3player.playTrack(rantrack);      // play track                         
          playtime();                                  // call function for play time       
         MP3player.stopTrack();                        // stop track   
          delay(pauseTime);                            // wait...   
    }
     
      delay(readingInterval);                          // wait with reading
   } 


// function to determine playtime

  void playtime() {
       startingMillis = millis();                                 // set both time counter
       currentMillis = millis();
      while ( currentMillis - startingMillis < playTime ) {      // while track plays, runs until playTime is reached
          currentMillis = millis();                               // set to actual time
          delay(40);                                              // debounce
       }     
   }




this is the code i have compiled to randomly play any track when motion is detected,all of it i found online!:D
now i am going to name the tracks in the SD card track000.mp3 and etc. The problem i am having is where do i change in the code for these names?? I got the libraries online.
I am on a deadline and a prompt answer is very much appreciated
Thanks ,Newbie
7  Using Arduino / Project Guidance / PIR sensor MP3 shield on: November 16, 2012, 10:00:27 pm
Hi,I am new to arduino and have no experince in c programming,my project involves an motion sensor detecting motion and activating the MP3 shield to ply a random track through the Arduino UNO,I have compiled codes I have found online together,I got the hardware together I just need help in software area.
8  Community / Gigs and Collaborations / Re: Motion Activated MP3 Shield(Help!!) on: November 15, 2012, 10:11:48 am
I can't tell whether the codes are in order,cause i got them online and I fun know programming!all the code suppose to do is receive the input for the PIR sensor and activate a random track on the shield
9  Community / Gigs and Collaborations / Re: Motion Activated MP3 Shield(Help!!) on: November 15, 2012, 07:23:06 am
Okok,based on the code I posted earlier with the said libraries will the code work?i need some one to verify it first?
10  Community / Gigs and Collaborations / Re: Motion Activated MP3 Shield(Help!!) on: November 14, 2012, 01:57:59 pm
I mean do I write playmp3"track00" where!!
11  Community / Gigs and Collaborations / Re: Motion Activated MP3 Shield(Help!!) on: November 14, 2012, 12:57:29 pm
Wat I mean is,in the SD card I name the track001.mp3,in the code where do I also name the track In the MP3 library?
12  Community / Gigs and Collaborations / Re: Motion Activated MP3 Shield(Help!!) on: November 14, 2012, 10:33:07 am
I have added these libraries To the sketch,figured it out but thanks anyway!i was trying to do it on my own but times running out and I am desperate!!my project is exactly the same with the YouTube video Arduino Cemetry Howler Project,i got the hardware down,I need help with the software.I followed the guys links ,but where do I name the tracks? Plz help!!
13  Community / Gigs and Collaborations / Motion Activated MP3 Shield(Help!!) on: November 14, 2012, 08:29:43 am
Hey guys,i am a FNG in the world of arduino and i despreatly  need help. My project is about the PIR sensor detecting motion and sending it to the Arduino Uno which will trigger the MP3 Shield,i have the code from online but how do u add the libraries to the sketch?
*/   

// libraries

    #include <SPI.h>
    #include <SdFat.h>
    #include <SdFatUtil.h>
    #include <SFEMP3Shield.h>
    SFEMP3Shield MP3player;

 
// constant variables 
     
    int pirPin = 5;                    // PIR sensor input pin
    int calibrationTime = 10;   
    unsigned long playTime = 15000;      // how long a file will play in milliseconds (15000=15 seconds)
    unsigned long pauseTime = 10000;     // how long the pause will be after the sound ends (10000=10 seconds)
    int readingInterval = 20;            // how often to read the sensor
 
   
// changing variables 
 

    int rantrack = 0;                    // track number for randomizing
    unsigned long currentMillis = 0;     // time variable to track running time: current time
    unsigned long startingMillis = 0;    // time variable to track running time: starting time
    byte result;                         // variable for mp3 player shield, can be used to debug
       
// setup     
     
    void setup() {
  pinMode(pirPin, INPUT);
  digitalWrite(pirPin, LOW);

  //give the sensor some time to calibrate
    for(int i = 0; i < calibrationTime; i++){
      delay(1000);
      }
    delay(50);

     pinMode(pirPin, INPUT);                        // make PIR sensor an input
      digitalWrite(pirPin, LOW);                    // activate internal pull-up resistor
      result = MP3player.begin();                      // start mp3 player shield
      MP3player.SetVolume(10, 10);                     // set volume of the mp3 player ( 0 = loudest )
    }
// loop
     
    void loop(){
      if (digitalRead(pirPin)== HIGH) {                // if movement sensed
          randomSeed(millis());                        // set a more random seed for the random function
          rantrack = random(55);                       // find random number
          result = MP3player.playTrack(rantrack);      // play track                         
          playtime();                                  // call function for play time       
         MP3player.stopTrack();                        // stop track   
          delay(pauseTime);                            // wait...   
    }
     
      delay(readingInterval);                          // wait with reading
   } 


// function to determine playtime

  void playtime() {
       startingMillis = millis();                                 // set both time counter
       currentMillis = millis();
      while ( currentMillis - startingMillis < playTime ) {      // while track plays, runs until playTime is reached
          currentMillis = millis();                               // set to actual time
          delay(40);                                              // debounce
       }     
   }

the help i need is in this:

    #include <SdFat.h>
    #include <SdFatUtil.h>
    #include <SFEMP3Shield.h>
    SFEMP3Shield MP3player;
how do i add these??Please URGENTLY reply!!
Thank You


14  Using Arduino / Project Guidance / Re: PIR sensor detects motions plays MP3 file on: November 02, 2012, 03:51:10 am
Can I use the project without the sensor shield and use an mP3 shield instead??also instead of connecting the buzzer can I connect the MP3 shield to the output pin?bear with me plz,it's my first time!!
15  Using Arduino / Project Guidance / PIR sensor detects motions plays MP3 file on: November 01, 2012, 08:31:25 pm
Hi everyone m this is my first time using arduino and I have zero experince I'm C programming.My project is relatively simple where the PIR sensor detects motion and sends it to the Arduino UNO which that will trigger the MP3 file.should I use and MP3 shield or MP3 Trigger??and also can some help me with the codes!!plz!:)
Pages: [1] 2