Skip to content
Snippets Groups Projects
Commit 7f4e0ed0 authored by Mario Engelmann's avatar Mario Engelmann
Browse files

hope for the best

parents d17b9a48 5798fb6b
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
#define MP3_H
void mp3Setup(void);
void playFile(uint8_t fileNumber);
void playFile(uint8_t fileNumber, bool respectBusyPin);
void mp3Loop(void);
void playFileQueue(uint8_t fileNumber);
......
......@@ -4,7 +4,7 @@
static SoftwareSerial mp3(MP3RX, MP3TX);
// the queue for playing sounds
#define QUEUESIZE 16
#define QUEUESIZE 64
static uint8_t fileQueue[QUEUESIZE];
// needs to be run once at the start
......@@ -14,8 +14,12 @@ void mp3Setup(void) {
//mp3.sendCommand(CMD_SEL_DEV, 0, 2); //select sd-card
}
// immediately play a file, ignoring any queue or BUSY pin
void playFile(uint8_t fileNumber) {
// immediately play a file
void playFile(uint8_t fileNumber, bool respectBusyPin) {
// do nothing if we want to wait for the BUSY pin
if (respectBusyPin && digitalRead(MP3BUSY)) {
return;
}
mp3.write(fileNumber);
}
......
......@@ -170,10 +170,17 @@ void setup(void) {
pinMode(BUTTON, INPUT_PULLUP);
}
<<<<<<< HEAD
void sayInfos(float temp1up, float temp1down, float temp2up, float temp2down, uint8_t comma)
=======
// say out all the relevant infos via the loudspeaker
void sayInfos(float t1up_C, float t1down_C, float t2up_C, float t2down_C)
>>>>>>> 5798fb6b122134e1e016b6e47ca39eb79566fdc7
{
const uint8_t decimals = 0;
playFileQueue(SOUND_EINS);
playFileQueue(SOUND_OBEN);
<<<<<<< HEAD
sayNumber(temp1up, nachKommaStellen);
playFileQueue(SOUND_STILLE);
......@@ -191,6 +198,21 @@ void sayInfos(float temp1up, float temp1down, float temp2up, float temp2down, ui
playFileQueue(SOUND_UNTEN);
sayNumber(temp2down, nachKommaStellen);
playFileQueue(SOUND_STILLE);
=======
sayNumber(t1up_C, decimals);
playFileQueue(SOUND_EINS);
playFileQueue(SOUND_UNTEN);
sayNumber(t1down_C, decimals);
playFileQueue(SOUND_ZWEI);
playFileQueue(SOUND_OBEN);
sayNumber(t2up_C, decimals);
playFileQueue(SOUND_ZWEI);
playFileQueue(SOUND_UNTEN);
sayNumber(t2down_C, decimals);
>>>>>>> 5798fb6b122134e1e016b6e47ca39eb79566fdc7
if (digitalRead(PUMP1))
{
......@@ -235,13 +257,12 @@ void loop(void) {
static float t1down_C = 0.0;
static float t2up_C = 0.0;
static float t2down_C = 0.0;
static int nachKommaStellen = 1;
mp3Loop();
if (checkButton() == LOW) {
displayLight(true);
sayInfos(t1up_C, t1down_C, t2up_C, t2down_C, nachKommaStellen);
sayInfos(t1up_C, t1down_C, t2up_C, t2down_C);
} else {
displayLight(false);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment