first real regulation errors

This commit is contained in:
phyto 2019-05-23 18:07:31 +02:00
parent af91555fe6
commit 2e4854c411
2 changed files with 25 additions and 6 deletions

View File

@ -101,25 +101,41 @@ void sendvalues(short *ptr)
prt('\n');
}
/* -------------------------------------------------- */
void update_and_send(void)
void update_and_send(short *pvalues)
{
short values[NBVAL];
updatevalues(values);
sendvalues(values);
updatevalues(pvalues);
sendvalues(pvalues);
}
/* ================================================== */
void loop() {
static int foo = 0;
int key;
short values[NBVAL], temp_interne;
update_and_send();
update_and_send(values);
temp_interne = values[1];
if (temp_interne < parametres.temp_mini) {
prtln("M temp is low");
delay(500);
controle_frigo(0);
}
else if (temp_interne > parametres.temp_maxi){
prtln("M temp is hight");
delay(500);
controle_frigo(1);
}
if (foo++ > 5) {
readlight(); foo = 0;
}
/* check for external request */
if (Serial.available()) {
key = Serial.read();
@ -146,6 +162,9 @@ void loop() {
break;
}
}
delay(parametres.delai);
/* ETERNAL LOOP END HERE */

View File

@ -46,7 +46,7 @@ wclear(glass); wrefresh(glass);
mfd = (fd_local>fd_remote ? fd_local : fd_remote) + 1; /* XXX */
#if DEBUG_LEVEL
#if DEBUG_LEVEL > 1
sprintf(ligne, "%s : mfd is %d\n", __func__, mfd);
waddstr(glass, ligne); wrefresh(glass);
#endif