Browse Source

hardware bug found, sorry

phyto 6 months ago
parent
commit
946616e55a
4 changed files with 22 additions and 6 deletions
  1. 3
    1
      essai.c
  2. 5
    3
      plot.sh
  3. 12
    2
      simulator/rdtemp/cli.ino
  4. 2
    0
      simulator/rdtemp/storage.ino

+ 3
- 1
essai.c View File

@@ -125,6 +125,7 @@ int main(int argc, char *argv[])
125 125
 int		opt;
126 126
 int		serial_in;
127 127
 char		*device = "/dev/ttyACM0";
128
+char		ligne[100];
128 129
 
129 130
 while ((opt = getopt(argc, argv, "d:hv")) != -1) {
130 131
 	switch (opt) {
@@ -150,7 +151,8 @@ sleep(1);
150 151
 initscr();
151 152
 nonl();         cbreak();       noecho();
152 153
 keypad(stdscr, TRUE);           /* acces aux touches 'curseur' */
153
-fond_ecran(" Demonstrator ");
154
+sprintf(ligne, " Demonstrator %d %s ", getpid(), device);
155
+fond_ecran(ligne);
154 156
 
155 157
 traite_les_messages(serial_in, 50000000);
156 158
 

+ 5
- 3
plot.sh View File

@@ -7,10 +7,12 @@ DATAFILE="serial/foo.dat"
7 7
 IMAGE="graphe.png"
8 8
 TMPFILE="/dev/shm/tmpdata"
9 9
 
10
-tail -10000 < ${DATAFILE} > ${TMPFILE}
10
+wc -l ${DATAFILE}
11
+
12
+tail -2500 < ${DATAFILE} > ${TMPFILE}
11 13
 
12 14
 gnuplot << __EOC__
13
-set term png 	size 1650,700
15
+set term png 	size 1600,800
14 16
 set output 	"${IMAGE}"
15 17
 set ytics	2
16 18
 set xtics	
@@ -24,6 +26,6 @@ plot	"${TMPFILE}" using 1:3 title " inside" with lines, \
24 26
 	"${TMPFILE}" using 1:4 title "ambient" with lines
25 27
 __EOC__
26 28
 
27
-display ${IMAGE}
29
+display ${IMAGE} &
28 30
 
29 31
 

+ 12
- 2
simulator/rdtemp/cli.ino View File

@@ -9,7 +9,6 @@
9 9
 
10 10
 #define DEBUG 0
11 11
 /* -------------------------------------------------- */
12
-/* some interesting macros */
13 12
 
14 13
 /* -------------------------------------------------- */
15 14
 char waitkey(char echo)
@@ -127,7 +126,18 @@ else {
127 126
   prtln("M frigo OFF");
128 127
   digitalWrite(RELAIS_FRIGO, LOW);
129 128
   }
130
-prtln("...");  
129
+}
130
+/* --------------------------------------------------------------- */
131
+void controle_ventilo(char on_off)
132
+{
133
+if (on_off) {
134
+  prtln("M ventilo ON");
135
+  digitalWrite(RELAIS_VENTILO, HIGH);
136
+  }
137
+else {
138
+  prtln("M ventilo OFF");
139
+  digitalWrite(RELAIS_VENTILO, LOW);
140
+  }
131 141
 }
132 142
 /* --------------------------------------------------------------- */
133 143
 

+ 2
- 0
simulator/rdtemp/storage.ino View File

@@ -41,6 +41,8 @@ from->control++;
41 41
 
42 42
 EEPROM.put(0, *from);
43 43
 
44
+/* no check of good write here ? */
45
+
44 46
 return -1;
45 47
 }
46 48
 /* --------------------------------------------------------------- */

Loading…
Cancel
Save