apero du mercredi soir, bugs are coming

This commit is contained in:
phyto
2019-04-03 19:53:15 +02:00
parent 953650c953
commit e6f4bf7a0f
5 changed files with 29 additions and 8 deletions

22
essai.c
View File

@@ -23,6 +23,17 @@ int idx, foo;
char ligne[200];
int Idatas[4];
float Fdatas[4];
FILE *fp;
time_t temps;
/* XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX */
fp = fopen("serial/foo.dat", "a");
if (NULL==fp) {
fprintf(stderr, "***** error fopen datafile *****\n");
return -1;
}
/* XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX */
for (idx=0; idx<nbloops; idx++) {
@@ -42,10 +53,17 @@ for (idx=0; idx<nbloops; idx++) {
for (foo=0; foo<3; foo++) {
sprintf(ligne, "%4d", Idatas[foo]);
minidigit_affstr(stdscr, 3+(12*foo), 4, ligne);
minidigit_affstr(stdscr, 6+(12*foo), 8, ligne);
aff7segs_float(stdscr, 3+(12*foo), 55, Fdatas[foo]);
}
if (NULL!=fp) {
temps = time(NULL);
fprintf(fp, "%ld %f %f %f %f\n", temps,
Fdatas[0], Fdatas[1], Fdatas[2], Fdatas[3]);
fflush(fp);
}
}
return 0;
}