Skip to content

Commit

Permalink
hardware serial for sound system
Browse files Browse the repository at this point in the history
  • Loading branch information
ClemensElflein committed Jul 19, 2022
1 parent 83164fa commit 5e7714f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Firmware/LowLevel/src/soundsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
#include <soundsystem.h>


SerialPIO soundSerial(PIN_SOUND_TX, PIN_SOUND_RX);
DFPlayerMini_Fast myMP3;


MP3Sound::MP3Sound()
{

Serial2.setTX(PIN_SOUND_TX);
Serial2.setRX(PIN_SOUND_RX);

this->anzSoundfiles = 0; // number of files stored on the SD-card
this->playing = false;
this->sound_available = false;
Expand All @@ -37,11 +39,11 @@ bool MP3Sound::begin(int anzsoundsOnSD)
{

// serial stream init for soundmodule
soundSerial.begin(9600);
while (soundSerial.available())
soundSerial.read();
Serial2.begin(9600);
while (Serial2.available())
Serial2.read();
// init soundmodule
sound_available = myMP3.begin(soundSerial,true);
sound_available = myMP3.begin(Serial2,true);
delay(1000);
return (sound_available);
}
Expand Down

0 comments on commit 5e7714f

Please sign in to comment.