slow down the temperatur log to file
This commit is contained in:
parent
6583891486
commit
32f7e6ad70
20
essai.c
20
essai.c
@ -24,7 +24,8 @@ char ligne[200];
|
|||||||
int Idatas[4];
|
int Idatas[4];
|
||||||
float Fdatas[4];
|
float Fdatas[4];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
time_t temps;
|
time_t temps,
|
||||||
|
old_temps = (time_t)0L;
|
||||||
|
|
||||||
|
|
||||||
/* XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX */
|
/* XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX */
|
||||||
@ -53,18 +54,25 @@ for (idx=0; idx<nbloops; idx++) {
|
|||||||
|
|
||||||
for (foo=0; foo<3; foo++) {
|
for (foo=0; foo<3; foo++) {
|
||||||
sprintf(ligne, "%4d", Idatas[foo]);
|
sprintf(ligne, "%4d", Idatas[foo]);
|
||||||
minidigit_affstr(stdscr, 6+(12*foo), 8, ligne);
|
minidigit_affstr(stdscr, 12+(12*foo), 8, ligne);
|
||||||
aff7segs_float(stdscr, 3+(12*foo), 55, Fdatas[foo]);
|
aff7segs_float(stdscr, 8+(12*foo), 55, Fdatas[foo]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* here we are trying to log all that temps values */
|
||||||
if (NULL!=fp) {
|
if (NULL!=fp) {
|
||||||
temps = time(NULL);
|
temps = time(NULL);
|
||||||
fprintf(fp, "%ld %f %f %f %f\n", temps,
|
if ((temps-old_temps) > 60) {
|
||||||
Fdatas[0], Fdatas[1], Fdatas[2], Fdatas[3]);
|
fprintf(fp, "%ld %f %f %f %f\n", temps,
|
||||||
fflush(fp);
|
Fdatas[0], Fdatas[1], Fdatas[2], Fdatas[3]);
|
||||||
|
fflush(fp);
|
||||||
|
old_temps = temps;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* --------------------------------------------------------------- */
|
/* --------------------------------------------------------------- */
|
||||||
|
Loading…
Reference in New Issue
Block a user