Hi @ardopool ,
generally for sound support posting the complete code is required ...
What's obvious in the partial code you posted is that the local variables
unsigned long previousSTime;
unsigned long startSTime;
unsigned long currentSTime = millis();
int Count = 0;
unsigned long Run = 1;
will lose their content everytime after run_Shower() has been executed.
So with any new call of the function Count will be set to Zero and incremented to 1 just before the switch statement. All other cases will never be performed.
If you want the variables Count, previousSTime and startSTime to "survive" for the next function call you must declare them outside the function as global variables OR declare them inside the function as "static int" or "static unsigned long". You should also initialize all variables before usage to be sure about their content.
There may be more issues but that cannot be checked without the complete code ...
Good luck!
ec2021