diff --git a/solarpump/solarpump.ino b/solarpump/solarpump.ino index 322510ce119df5c7178a03d77981297abbbe6dcf..2038dfaebaafea4317f27c2a0eceaa3a20f297fd 100644 --- a/solarpump/solarpump.ino +++ b/solarpump/solarpump.ino @@ -170,6 +170,51 @@ void setup(void) { pinMode(BUTTON, INPUT_PULLUP); } +void sayInfos(void) +{ + playFileQueue(SOUND_EINS); + playFileQueue(SOUND_OBEN); + sayNumber(t1up_C, nachKommaStellen); + + playFileQueue(SOUND_EINS); + playFileQueue(SOUND_UNTEN); + sayNumber(t1down_C, nachKommaStellen); + + playFileQueue(SOUND_ZWEI); + playFileQueue(SOUND_OBEN); + sayNumber(t2up_C, nachKommaStellen); + + playFileQueue(SOUND_ZWEI); + playFileQueue(SOUND_UNTEN); + sayNumber(t2down_C, nachKommaStellen); + + if (digitalRead(PUMP1)) + { + playFileQueue(SOUND_PUMPE); + playFileQueue(SOUND_EINS); + playFileQueue(SOUND_AN); + } + else + { + playFileQueue(SOUND_PUMPE); + playFileQueue(SOUND_EINS); + playFileQueue(SOUND_AUS); + } + + if (digitalRead(PUMP2)) + { + playFileQueue(SOUND_PUMPE); + playFileQueue(SOUND_ZWEI); + playFileQueue(SOUND_AN); + } + else + { + playFileQueue(SOUND_PUMPE); + playFileQueue(SOUND_ZWEI); + playFileQueue(SOUND_AUS); + } +} + /* * main loop function * 1. Check if button was pressed. @@ -188,47 +233,7 @@ void loop(void) { if (checkButton() == LOW) { displayLight(true); - playFileQueue(SOUND_EINS); - playFileQueue(SOUND_OBEN); - sayNumber(t1up_C, nachKommaStellen); - - playFileQueue(SOUND_EINS); - playFileQueue(SOUND_UNTEN); - sayNumber(t1down_C, nachKommaStellen); - - playFileQueue(SOUND_ZWEI); - playFileQueue(SOUND_OBEN); - sayNumber(t2up_C, nachKommaStellen); - - playFileQueue(SOUND_ZWEI); - playFileQueue(SOUND_UNTEN); - sayNumber(t2down_C, nachKommaStellen); - - if (digitalRead(PUMP1)) - { - playFileQueue(SOUND_PUMPE); - playFileQueue(SOUND_EINS); - playFileQueue(SOUND_AN); - } - else - { - playFileQueue(SOUND_PUMPE); - playFileQueue(SOUND_EINS); - playFileQueue(SOUND_AUS); - } - - if (digitalRead(PUMP2)) - { - playFileQueue(SOUND_PUMPE); - playFileQueue(SOUND_ZWEI); - playFileQueue(SOUND_AN); - } - else - { - playFileQueue(SOUND_PUMPE); - playFileQueue(SOUND_ZWEI); - playFileQueue(SOUND_AUS); - } + sayInfo(); } else { displayLight(false); }