Un échange d'information autour de la carte KeyDuino
 
HomeHome  FAQFAQ  RegisterRegister  Log inLog in  

Share | 
 

 Personal Sound Track Music Box

View previous topic View next topic Go down 
AuthorMessage
Andriod
beginner
beginner


Messages : 18
Reputation : 0
Date d'inscription : 2016-03-20

PostSubject: Personal Sound Track Music Box   Sun 27 Mar - 21:39

My plan here is to have a Keyduino and an MP3 player hidden in a box near my front door. When myself, my wife, or other regular guests enter we can scan the NFC either in our phone or an NFCRing it will start playing a song we've previously selected and placed on the MicroSD card.

The trick is making this easy enough to maintain, so I'm planning to record any tag scanned so that we can figure out what the ID is easily and set the song for a new tag. Further extensions would be to make this the front door tag of a smart home system--but I really intend to use GPS for that.
Back to top Go down
MrStein
KeyDuino TEAM
avatar

Messages : 59
Reputation : 3
Date d'inscription : 2015-10-10
Age : 23
Localisation : Lille, FRANCE

PostSubject: Re: Personal Sound Track Music Box   Sat 9 Apr - 15:13

Wo, cool Smile we make a simular project (you can see it on the kickstarter video) with LED effect.
Here is the code:

Code:
#include "KeyDuino.h"
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SFEMP3Shield.h>


KeyDuino keyDuino;

String NFC_KEY_1 = "xxxxxxxxxxxx";
String NFC_KEY_2 = "xxxxxxxxxxxx";

uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 };
uint8_t uidLength;

SdFat sd;
SFEMP3Shield MP3player;

int8_t current_track = 1;

void setup() {
  Serial.begin(115200);
  keyDuino.begin();

  if (!sd.begin(9, SPI_HALF_SPEED)) sd.initErrorHalt();
  if (!sd.chdir("/")) sd.errorHalt("sd.chdir");
  MP3player.begin();
  MP3player.setVolume(10, 10);

  Serial.println("KeyDuino SOUND is ready, please scan a NFC tag");
}


void loop() {
  uint8_t success;
  String readID;
  success = keyDuino.readTargetID(uid, &uidLength);
  if (success) {
    if (readID == NFC_KEY_1) MP3player.playTrack(1);
    else if (readID == NFC_KEY_1) MP3player.playTrack(2);
    else  MP3player.stopTrack();
  }
}

Keep us in touch for your project!
Back to top Go down
http://keyduino.forumsactifs.com
 
Personal Sound Track Music Box
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» "The Rain in Spain Stays Mainly in the Plain"
» Sound of Music-Tonight
» Sound of Music sing-along party, anyone?
» Favorite Music
» Capacitor and sound quality

Permissions in this forum:You cannot reply to topics in this forum
KeyDuino forum :: KeyDuino projects & tutorial :: Projects :: WIP projets-
Jump to: