apero du mercredi soir, bugs are coming
This commit is contained in:
parent
953650c953
commit
e6f4bf7a0f
1
.gitignore
vendored
1
.gitignore
vendored
@ -17,6 +17,7 @@ doc/*.ind
|
|||||||
|
|
||||||
*/*.dat
|
*/*.dat
|
||||||
|
|
||||||
|
*.png
|
||||||
rrdb/*.png
|
rrdb/*.png
|
||||||
serial/*.png
|
serial/*.png
|
||||||
|
|
||||||
|
22
essai.c
22
essai.c
@ -23,6 +23,17 @@ int idx, foo;
|
|||||||
char ligne[200];
|
char ligne[200];
|
||||||
int Idatas[4];
|
int Idatas[4];
|
||||||
float Fdatas[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++) {
|
for (idx=0; idx<nbloops; idx++) {
|
||||||
|
|
||||||
@ -42,10 +53,17 @@ 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, 3+(12*foo), 4, ligne);
|
minidigit_affstr(stdscr, 6+(12*foo), 8, ligne);
|
||||||
|
|
||||||
aff7segs_float(stdscr, 3+(12*foo), 55, Fdatas[foo]);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
10
plot.sh
10
plot.sh
@ -7,7 +7,7 @@ DATAFILE="serial/foo.dat"
|
|||||||
IMAGE="graphe.png"
|
IMAGE="graphe.png"
|
||||||
TMPFILE="/tmp/tmpdata"
|
TMPFILE="/tmp/tmpdata"
|
||||||
|
|
||||||
tail -400 < ${DATAFILE} > ${TMPFILE}
|
tail -700 < ${DATAFILE} > ${TMPFILE}
|
||||||
|
|
||||||
gnuplot << __EOC__
|
gnuplot << __EOC__
|
||||||
set term png size 1000,700
|
set term png size 1000,700
|
||||||
@ -15,13 +15,13 @@ set output "${IMAGE}"
|
|||||||
set ytics 2
|
set ytics 2
|
||||||
set xtics
|
set xtics
|
||||||
set grid front
|
set grid front
|
||||||
set title "* Temperatures *"
|
set title "* Temperatures du Phytotron *"
|
||||||
set xdata time
|
set xdata time
|
||||||
set timefmt "%s"
|
set timefmt "%s"
|
||||||
set format x "%d\n%H:%M"
|
set format x "%b %d\n%H:%M"
|
||||||
set yrange [ 0.0 : 30.0 ]
|
set yrange [ 0.0 : 30.0 ]
|
||||||
plot "${TMPFILE}" using 1:3 title "ambient" with lines, \
|
plot "${TMPFILE}" using 1:3 title " inside" with lines, \
|
||||||
"${TMPFILE}" using 1:4 title " inside" with lines
|
"${TMPFILE}" using 1:4 title "ambient" with lines
|
||||||
__EOC__
|
__EOC__
|
||||||
|
|
||||||
display ${IMAGE}
|
display ${IMAGE}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DEVICE="/dev/ttyACM1"
|
DEVICE="/dev/ttyACM0"
|
||||||
DATAFILE="foo.dat"
|
DATAFILE="foo.dat"
|
||||||
TMPFILE="/tmp/dd2data"
|
TMPFILE="/tmp/dd2data"
|
||||||
|
|
||||||
|
@ -5,11 +5,13 @@
|
|||||||
int fond_ecran(char *titre);
|
int fond_ecran(char *titre);
|
||||||
int message(char *);
|
int message(char *);
|
||||||
|
|
||||||
|
|
||||||
int aff7segs_base(WINDOW * win, int lig, int col, int bits, int k);
|
int aff7segs_base(WINDOW * win, int lig, int col, int bits, int k);
|
||||||
int aff7segs_digit(WINDOW * win, int lig, int col, char digit);
|
int aff7segs_digit(WINDOW * win, int lig, int col, char digit);
|
||||||
int aff7segs_short(WINDOW * win, int lig, int col, short value);
|
int aff7segs_short(WINDOW * win, int lig, int col, short value);
|
||||||
int aff7segs_float(WINDOW * win, int lig, int col, float value);
|
int aff7segs_float(WINDOW * win, int lig, int col, float value);
|
||||||
|
|
||||||
|
|
||||||
int minidigit_0(WINDOW *win, int lig, int col, char digit, int k);
|
int minidigit_0(WINDOW *win, int lig, int col, char digit, int k);
|
||||||
int minidigit_affstr(WINDOW *win, int lig, int col, char *str);
|
int minidigit_affstr(WINDOW *win, int lig, int col, char *str);
|
||||||
int minidigit_HMS(WINDOW *win, int lig, int col, int k);
|
int minidigit_HMS(WINDOW *win, int lig, int col, int k);
|
||||||
|
Loading…
Reference in New Issue
Block a user