Forum Software Ferduino code Automatic wave maker mode change

Automatic wave maker mode change  [SOLVED]


Post Number:#1 Post Wed Jul 02, 2014 4:49 pm
Posts: 68
Topics: 2
Solve rating: 0
Joined: Thu Apr 10, 2014 7:59 pm
Topics: 2
Age: 57
Location: Barbourville, Kentucky
Gender: Male
National Flag:
United States of America
Fernando,

how easy would it be to make the wave maker change modes every 2 hours, make it programmable to run a specific mode for a set amount of time, then run in another mode and continually change modes ?

I think the randomness would be nice for the tank so it get's a different wave pattern every so often

Post Number:#2 Post Wed Jul 02, 2014 6:38 pm
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 40
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

You can make it using a method very simple.

Add in ferduino tab:

unsigned long interval_wave_millis = 0;
int interval_wave = 120; // in minutes
boolean alternated_mode = true;


Add on loop:

if(alternated_mode == true)
{
  if((millis() - interval_wave_millis) > (interval_wave*60000))
  {
    modo_selecionado += 1;

    if(modo_selecionado > 5)
    {
      modo_selecionado = 1
    }
    interval_wave_millis = millis();
  }
}


Best regards.
Post your doubts on forum because it can help another user too. Just PM me for support if it's absolutely necessary.

Post Number:#3 Post Wed Jul 02, 2014 7:39 pm
Posts: 68
Topics: 2
Solve rating: 0
Joined: Thu Apr 10, 2014 7:59 pm
Topics: 2
Age: 57
Location: Barbourville, Kentucky
Gender: Male
National Flag:
United States of America
awesome, OK I added this to the ferduino tab at the very bottom as below



  215, 210, 205, 200, 190, 185, 180, 175,   //16 - 17
  170, 165, 160, 160, 160, 150, 145, 140,   //18 - 19
  135, 130, 125, 115, 100, 75, 60, 30,      //20 - 21
  30, 30, 28, 28, 0, 0, 0, 0                //22 - 23
};

byte *cor[5] = {wled, bled, rbled, rled, uvled};
byte *cor_canal[5] = {cor_canal1, cor_canal2, cor_canal3, cor_canal4, cor_canal5};

/***************************************************************************/
/************* automatic mode change for wavemaker *************************/
/***************************************************************************/

unsigned long interval_wave_millis = 0;
int interval_wave = 120; // in minutes
boolean alternated_mode = true;





OK I got it now, you have an [ ; ] missing in the above code Fernando :D

I add to loop.ino like below

  Wavemaker();
 
  if(alternated_mode == true)
{
  if((millis() - interval_wave_millis) > (interval_wave*60000))
  {
    modo_selecionado += 1;

    if(modo_selecionado > 5)
    {
      modo_selecionado = 1;
    }
    interval_wave_millis = millis();
  }
}
 
  if (dispScreen == 10) // Desenha os gráficos enquanto o menu estiver aberto.
  {
    Grafico_WaveMaker();
  }
 
  if (millis() - previousMillis > 5000)  // Verifica as funções a cada 5 segundos.
  {



changed time to 1 minute and tested, the screen on the Ferduino display remains as is but the bar graph changes as the mode changes very nice man thank you




Return to Ferduino code





Who is online

Users viewing this topic: No registered users and 0 guests