hardware bug found, sorry
This commit is contained in:
parent
7a3ba3b44c
commit
946616e55a
4
essai.c
4
essai.c
@ -125,6 +125,7 @@ int main(int argc, char *argv[])
|
||||
int opt;
|
||||
int serial_in;
|
||||
char *device = "/dev/ttyACM0";
|
||||
char ligne[100];
|
||||
|
||||
while ((opt = getopt(argc, argv, "d:hv")) != -1) {
|
||||
switch (opt) {
|
||||
@ -150,7 +151,8 @@ sleep(1);
|
||||
initscr();
|
||||
nonl(); cbreak(); noecho();
|
||||
keypad(stdscr, TRUE); /* acces aux touches 'curseur' */
|
||||
fond_ecran(" Demonstrator ");
|
||||
sprintf(ligne, " Demonstrator %d %s ", getpid(), device);
|
||||
fond_ecran(ligne);
|
||||
|
||||
traite_les_messages(serial_in, 50000000);
|
||||
|
||||
|
8
plot.sh
8
plot.sh
@ -7,10 +7,12 @@ DATAFILE="serial/foo.dat"
|
||||
IMAGE="graphe.png"
|
||||
TMPFILE="/dev/shm/tmpdata"
|
||||
|
||||
tail -10000 < ${DATAFILE} > ${TMPFILE}
|
||||
wc -l ${DATAFILE}
|
||||
|
||||
tail -2500 < ${DATAFILE} > ${TMPFILE}
|
||||
|
||||
gnuplot << __EOC__
|
||||
set term png size 1650,700
|
||||
set term png size 1600,800
|
||||
set output "${IMAGE}"
|
||||
set ytics 2
|
||||
set xtics
|
||||
@ -24,6 +26,6 @@ plot "${TMPFILE}" using 1:3 title " inside" with lines, \
|
||||
"${TMPFILE}" using 1:4 title "ambient" with lines
|
||||
__EOC__
|
||||
|
||||
display ${IMAGE}
|
||||
display ${IMAGE} &
|
||||
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
#define DEBUG 0
|
||||
/* -------------------------------------------------- */
|
||||
/* some interesting macros */
|
||||
|
||||
/* -------------------------------------------------- */
|
||||
char waitkey(char echo)
|
||||
@ -127,7 +126,18 @@ else {
|
||||
prtln("M frigo OFF");
|
||||
digitalWrite(RELAIS_FRIGO, LOW);
|
||||
}
|
||||
prtln("...");
|
||||
}
|
||||
/* --------------------------------------------------------------- */
|
||||
void controle_ventilo(char on_off)
|
||||
{
|
||||
if (on_off) {
|
||||
prtln("M ventilo ON");
|
||||
digitalWrite(RELAIS_VENTILO, HIGH);
|
||||
}
|
||||
else {
|
||||
prtln("M ventilo OFF");
|
||||
digitalWrite(RELAIS_VENTILO, LOW);
|
||||
}
|
||||
}
|
||||
/* --------------------------------------------------------------- */
|
||||
|
||||
|
@ -41,6 +41,8 @@ from->control++;
|
||||
|
||||
EEPROM.put(0, *from);
|
||||
|
||||
/* no check of good write here ? */
|
||||
|
||||
return -1;
|
||||
}
|
||||
/* --------------------------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user