Skip to content

Commit

Permalink
new sketch rev 05
Browse files Browse the repository at this point in the history
  • Loading branch information
roboticboyer committed Aug 10, 2019
1 parent 0970f72 commit 58a44d1
Show file tree
Hide file tree
Showing 2 changed files with 115 additions and 5 deletions.
Binary file added Sources/Canta_Storie_DF_Player_05.ino.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <SoftwareSerial.h>
#include <DFMiniMp3.h>
// https://github.com/Makuna/DFMiniMp3


#include <Wire.h>
Expand All @@ -20,11 +21,27 @@
PN532_I2C pn532i2c(Wire);
PN532 nfc(pn532i2c);

const uint8_t uid_ok1[] = { 0x4, 0xB1, 0x63, 0xDA, 0x31, 0x5B, 0x80 }; //UID SPT Subway
const uint8_t uid_ok1[] = { 0x4, 0xB1, 0x63, 0xDA, 0x31, 0x5B, 0x80 }; //UID SPT Subway 1
const uint8_t uid_ok2[] = { 0x4, 0x42, 0x55, 0x72, 0x62, 0x57, 0x80 }; //UID ciondolo viola
const uint8_t uid_ok3[] = { 0xF6, 0x99, 0xBD, 0xAC,0,0,0 }; //UID ciondolo rosso
const uint8_t uid_ok4[] = { 0x4, 0x4D, 0x23, 0x2A, 0x52, 0x5D, 0x85 }; //UID GTT1
const uint8_t uid_ok5[] = { 0x4, 0x4B, 0x23, 0x2A, 0x52, 0x5D, 0x85 }; //UID GTT2
const uint8_t uid_ok6[] = { 0x4, 0x47, 0x3D, 0xDA, 0x64, 0x5D, 0x81 }; //UID GTT3
const uint8_t uid_ok7[] = { 0x5, 0x77, 0x7C, 0x6A, 0x99, 0x54, 0xE9 }; //UID GTT4
const uint8_t uid_ok8[] = { 0x5, 0x7D, 0x8C, 0xB9, 0x59, 0x54, 0xE9 }; //UID GTT5


const uint8_t uid_ok9[] = { 0x5, 0x76, 0x23, 0x1A, 0xE9, 0x54, 0xE9 }; //UID SPT Subway 2

const uint8_t uid_ok10[] = { 0x5, 0x7D, 0x62, 0x7B, 0x5A, 0x54, 0xE9 }; //UID SPT Subway 3


const uint8_t uid_ok11[] = { 0x5, 0x72, 0x8E, 0x19, 0x7A, 0x54, 0xE9 }; //UID SPT Subway 4


const uint8_t uid_ok12[] = { 0x5, 0x73, 0x7B, 0x9B, 0xE9, 0x54, 0xE9 }; //UID SPT Subway 5

int volume=15;

const int secondi=60;

Expand Down Expand Up @@ -92,7 +109,7 @@ void setup()
uint16_t volume = mp3.getVolume();
Serial.print("volume ");
Serial.println(volume);
mp3.setVolume(15);
mp3.setVolume(volume);

uint16_t count = mp3.getTotalTrackCount();
Serial.print("files ");
Expand Down Expand Up @@ -170,40 +187,133 @@ int test=1;
if (test==0) {
Serial.println("Carta SPT Subway");
Serial.println("track 1");
mp3.playMp3FolderTrack(10);
delay(500);
mp3.playMp3FolderTrack(1); // sd:/mp3/0001.mp3
}

test=memcmp(uid,uid_ok4,sizeof(uid));
if (test==0) {
Serial.println("Carta GTT1");
Serial.println("track 2");
Serial.println("track 2");
mp3.playMp3FolderTrack(10);
delay(500);
mp3.playMp3FolderTrack(2); // sd:/mp3/0001.mp3
}

test=memcmp(uid,uid_ok5,sizeof(uid));
if (test==0) {
Serial.println("Carta GTT2");
Serial.println("track 3");
mp3.playMp3FolderTrack(10);
delay(500);
mp3.playMp3FolderTrack(3); // sd:/mp3/0001.mp3
}

test=memcmp(uid,uid_ok6,sizeof(uid));
if (test==0) {
Serial.println("Carta GTT3");
Serial.println("track 3");
mp3.playMp3FolderTrack(10);
delay(500);
mp3.playMp3FolderTrack(6); // sd:/mp3/0001.mp3
}

//------------------------------------------------
test=memcmp(uid,uid_ok7,sizeof(uid));
if (test==0) {
Serial.println("Carta GTT4");
Serial.println("track 3");
mp3.playMp3FolderTrack(10);
delay(500);
mp3.playMp3FolderTrack(5); // sd:/mp3/0001.mp3
}

//------------------------------------------------
test=memcmp(uid,uid_ok9,sizeof(uid));
if (test==0) {
Serial.println("SPT Subway 2");
Serial.println("track 100");
mp3.playMp3FolderTrack(10);
delay(500);
mp3.playMp3FolderTrack(100); // sd:/mp3/0001.mp3
}
//------------------------------------------------
test=memcmp(uid,uid_ok10,sizeof(uid));
if (test==0) {
Serial.println("SPT Subway 3");
Serial.println("track 101");
mp3.playMp3FolderTrack(10);
delay(500);
mp3.playMp3FolderTrack(101); // sd:/mp3/0001.mp3
}

//------------------------------------------------

test=memcmp(uid,uid_ok2,sizeof(uid));
if (test==0) {
Serial.println("Ciondolo Viola");

}
}

//------------------------------------------------
test=memcmp(uid,uid_ok8,sizeof(uid));
if (test==0) {
Serial.println("Carta GTT4");
Serial.println("Stop");
mp3.playMp3FolderTrack(10);
delay(500);
mp3.stop(); // stop
}
//------------------------------------------------


//------------------------------------------------
test=memcmp(uid,uid_ok11,sizeof(uid));
if (test==0) {
Serial.println("SPT Subway 4");

if (volume<21){
Serial.println("volume+");
mp3.setVolume(++volume);}
}
//------------------------------------------------


//------------------------------------------------
test=memcmp(uid,uid_ok12,sizeof(uid));
if (test==0) {
Serial.println("SPT Subway 5");
if (volume>9){
Serial.println("volume-");
mp3.setVolume(--volume);}
}
//------------------------------------------------




} //End Test uid_lenght 7

if(uidLength==4){

/*
test=memcmp(uid,uid_ok3,sizeof(uid));
if (test==0) {
Serial.println("Ciondolo Rosso");
Serial.println("track 4");
mp3.playMp3FolderTrack(4); // sd:/mp3/0002.mp3
}
*/

test=memcmp(uid,uid_ok3,sizeof(uid));
if (test==0) {
Serial.println("Ciondolo Rosso");
Serial.println("Stop");
mp3.stop(); // stop
}

}
} //End Test uid_lenght 7
Serial.println("");
}
else
Expand Down

0 comments on commit 58a44d1

Please sign in to comment.