From 5798fb6b122134e1e016b6e47ca39eb79566fdc7 Mon Sep 17 00:00:00 2001 From: Stefan Gehr <stefan.kerman.gehr@fau.de> Date: Thu, 13 Oct 2022 16:44:30 +0200 Subject: [PATCH] merge --- solarpump/mp3.ino | 2 +- solarpump/solarpump.ino | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/solarpump/mp3.ino b/solarpump/mp3.ino index 3436883..c54977d 100644 --- a/solarpump/mp3.ino +++ b/solarpump/mp3.ino @@ -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 diff --git a/solarpump/solarpump.ino b/solarpump/solarpump.ino index d866a45..21a53ae 100644 --- a/solarpump/solarpump.ino +++ b/solarpump/solarpump.ino @@ -170,23 +170,25 @@ void setup(void) { pinMode(BUTTON, INPUT_PULLUP); } -void sayInfos(float temp1up, float temp1down, float temp2up, float temp2down) +// say out all the relevant infos via the loudspeaker +void sayInfos(float t1up_C, float t1down_C, float t2up_C, float t2down_C) { + const uint8_t decimals = 0; playFileQueue(SOUND_EINS); playFileQueue(SOUND_OBEN); - sayNumber(temp1up, nachKommaStellen); + sayNumber(t1up_C, decimals); playFileQueue(SOUND_EINS); playFileQueue(SOUND_UNTEN); - sayNumber(temp1down, nachKommaStellen); + sayNumber(t1down_C, decimals); playFileQueue(SOUND_ZWEI); playFileQueue(SOUND_OBEN); - sayNumber(temp2up, nachKommaStellen); + sayNumber(t2up_C, decimals); playFileQueue(SOUND_ZWEI); playFileQueue(SOUND_UNTEN); - sayNumber(temp2down, nachKommaStellen); + sayNumber(t2down_C, decimals); if (digitalRead(PUMP1)) { @@ -227,13 +229,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); } -- GitLab