mirror of
https://github.com/xfjx/TonUINO.git
synced 2025-08-18 16:51:17 +02:00
Merge pull request #57 from seisfeld/library-fix
update für DFMiniMp3 v1.0.6
This commit is contained in:
35
Tonuino.ino
35
Tonuino.ino
@@ -91,29 +91,26 @@ class Mp3Notify {
|
|||||||
Serial.print("Com Error ");
|
Serial.print("Com Error ");
|
||||||
Serial.println(errorCode);
|
Serial.println(errorCode);
|
||||||
}
|
}
|
||||||
static void OnPlayFinished(uint16_t track) {
|
static void PrintlnSourceAction(DfMp3_PlaySources source, const char* action) {
|
||||||
|
if (source & DfMp3_PlaySources_Sd) Serial.print("SD Karte ");
|
||||||
|
if (source & DfMp3_PlaySources_Usb) Serial.print("USB ");
|
||||||
|
if (source & DfMp3_PlaySources_Flash) Serial.print("Flash ");
|
||||||
|
Serial.println(action);
|
||||||
|
}
|
||||||
|
static void OnPlayFinished(DfMp3_PlaySources source, uint16_t track) {
|
||||||
// Serial.print("Track beendet");
|
// Serial.print("Track beendet");
|
||||||
// Serial.println(track);
|
// Serial.println(track);
|
||||||
// delay(100);
|
// delay(100);
|
||||||
nextTrack(track);
|
nextTrack(track);
|
||||||
}
|
}
|
||||||
static void OnCardOnline(uint16_t code) {
|
static void OnPlaySourceOnline(DfMp3_PlaySources source) {
|
||||||
Serial.println(F("SD Karte online "));
|
PrintlnSourceAction(source, "online");
|
||||||
}
|
}
|
||||||
static void OnCardInserted(uint16_t code) {
|
static void OnPlaySourceInserted(DfMp3_PlaySources source) {
|
||||||
Serial.println(F("SD Karte bereit "));
|
PrintlnSourceAction(source, "bereit");
|
||||||
}
|
}
|
||||||
static void OnCardRemoved(uint16_t code) {
|
static void OnPlaySourceRemoved(DfMp3_PlaySources source) {
|
||||||
Serial.println(F("SD Karte entfernt "));
|
PrintlnSourceAction(source, "entfernt");
|
||||||
}
|
|
||||||
static void OnUsbOnline(uint16_t code) {
|
|
||||||
Serial.println(F("USB online "));
|
|
||||||
}
|
|
||||||
static void OnUsbInserted(uint16_t code) {
|
|
||||||
Serial.println(F("USB bereit "));
|
|
||||||
}
|
|
||||||
static void OnUsbRemoved(uint16_t code) {
|
|
||||||
Serial.println(F("USB entfernt "));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -719,13 +716,13 @@ void waitForTrackToFinish() {
|
|||||||
void setup() {
|
void setup() {
|
||||||
|
|
||||||
Serial.begin(115200); // Es gibt ein paar Debug Ausgaben über die serielle Schnittstelle
|
Serial.begin(115200); // Es gibt ein paar Debug Ausgaben über die serielle Schnittstelle
|
||||||
|
|
||||||
// Wert für randomSeed() erzeugen durch das mehrfache Sammeln von rauschenden LSBs eines offenen Analogeingangs
|
// Wert für randomSeed() erzeugen durch das mehrfache Sammeln von rauschenden LSBs eines offenen Analogeingangs
|
||||||
uint32_t ADC_LSB;
|
uint32_t ADC_LSB;
|
||||||
uint32_t ADCSeed;
|
uint32_t ADCSeed;
|
||||||
for(uint8_t i = 0; i < 128; i++) {
|
for (uint8_t i = 0; i < 128; i++) {
|
||||||
ADC_LSB = analogRead(openAnalogPin) & 0x1;
|
ADC_LSB = analogRead(openAnalogPin) & 0x1;
|
||||||
ADCSeed ^= ADC_LSB << (i % 32);
|
ADCSeed ^= ADC_LSB << (i % 32);
|
||||||
}
|
}
|
||||||
randomSeed(ADCSeed); // Zufallsgenerator initialisieren
|
randomSeed(ADCSeed); // Zufallsgenerator initialisieren
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user