From 32f7e6ad706b5c51269c407ec1f4d2763d0ceabf Mon Sep 17 00:00:00 2001 From: phyto Date: Wed, 10 Apr 2019 17:13:54 +0200 Subject: [PATCH] slow down the temperatur log to file --- essai.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/essai.c b/essai.c index c716948..52fb5df 100644 --- a/essai.c +++ b/essai.c @@ -24,7 +24,8 @@ char ligne[200]; int Idatas[4]; float Fdatas[4]; FILE *fp; -time_t temps; +time_t temps, + old_temps = (time_t)0L; /* XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX */ @@ -53,18 +54,25 @@ for (idx=0; idx 60) { + fprintf(fp, "%ld %f %f %f %f\n", temps, + Fdatas[0], Fdatas[1], Fdatas[2], Fdatas[3]); + fflush(fp); + old_temps = temps; + } } } + +fclose(fp); + return 0; } /* --------------------------------------------------------------- */