In my old controller I used THIS program to automatically change the wavemaker modes, this works great.
In my new controller I also want to change the wavemaker modes, but I only want to do that when choosing wavemaker mode 5. If I choose one of the other 4 modes, I want that mode only to work.
I made the following changes:
in ferduino tab on the beginning
Code: Select all
// for alternating mode wavemakers
#define alternating_wave
At the end of ferduino tab
Code: Select all
unsigned long interval_wave_millis = 0;
int interval_wave = 120; // in minutes
boolean alternated_mode = false ;
in wavemaker tab
Code: Select all
else if (modo_selecionado == 5)
if (modo_selecionado == 5)
#ifdef alternating_wave
if (modo_selecionado == 5)
{
alternated_mode = true ;
}
else
{
alternated_mode = false ;
}
#endif
and on Loop tab
Code: Select all
Wavemaker();
//******************
#ifdef alternating_wave
#endif
if (alternated_mode == true )
{
if((millis() - interval_wave_millis) > (interval_wave*60000))
{
modo_selecionado += 1;
if(modo_selecionado > 4)
{
modo_selecionado = 1;
}
interval_wave_millis = millis();
}
}
//******************
If I choose 1,2,3 or 4, the mode stays the same so that is ok.
If I choose mode 5, the mode of the wave makers starts to change every 2 hours so that is also ok.
But when I choose one of the other modes after mode 5 it keeps changing every 2 hours instead of only the selected mode.
Can you give me advice or help me with this
Kind regards Len