Forum Software Ferduino code Clock in the mainscreeen second by second

Clock in the mainscreeen second by second  [SOLVED]


Post Number:#1 Post Fri Dec 19, 2014 7:20 am
Posts: 24
Topics: 8
Solve rating: 0
Joined: Thu Nov 06, 2014 9:20 am
Topics: 8
Age: 50
Gender: None specified
National Flag:
Portugal
Hello Fernando,

I would like refresh the clock second by second in the mainscreen = 0.
For to do that I would like to know if in the loop I can change the expression from:
if (millis() - previousMillis > 5000) // Verifica as funções a cada 5 segundos.
{
checkTempC(); // Verifica as temperaturas.
reposicao_agua_doce(); // Verifica se há a necessidade reposição da água doce.
check_nivel(); // Verifica se há algum problema com os níveis dos aquários.
check_PH_reator(); // Verifica o PH do reatpr de cálcio.
check_PH_aquario(); // Verifica o PH do aquário.
check_densidade(); // Verifica a densidade.
check_ORP(); // Verifica o ORP;
check_alarme(); // Verifica os alarmes.
check_temporizadores(); // Ativa ou desativa os timers.

if(LEDtestTick == false) // Atualiza se o teste de todos os leds não estiver em andamento.
{
min_cnt = NumMins(t.hour,t.min); // Atualiza o intervalo para determinar a potência dos leds.
}
if (dispScreen == 0)
{
mainScreen(); // Atualiza tela inicial.
}

if(suavizar <= 1)
{
suavizar += 0.1;
}
previousMillis = millis();
}

To this:
if (millis() - previousMillis > 1000) // Verifica as funções a cada 1 segundo.

Is this change is bed for the rest of code ferduino? :-\

Best Regards

Post Number:#2 Post Fri Dec 19, 2014 7:38 am
Posts: 1699
Topics: 38
Images: 301
Solve rating: 233
Joined: Mon Mar 03, 2014 5:59 pm
Topics: 38
Age: 39
Location: São Paulo
Gender: Male
National Flag:
Brazil

Hi!

This is a bad idea.

My suggestion is create a new condition on loop on this way.

In the tab Ferduino add:

unsigned long Millis_MainScreen = 0;


On loop use it:

if((millis() - Millis_MainScreen) > 1000)
{
  if (dispScreen == 0)
 {
  mainScreen(); // Atualiza tela inicial.
 }
Millis_MainScreen = 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 Fri Dec 19, 2014 9:37 am
Posts: 24
Topics: 8
Solve rating: 0
Joined: Thu Nov 06, 2014 9:20 am
Topics: 8
Age: 50
Gender: None specified
National Flag:
Portugal
Great fernando,
that's right :ymapplause:

Norberto Pinheiro




Return to Ferduino code





Who is online

Users viewing this topic: No registered users and 1 guest

cron