premiere mesure de temperature avec le LM35

This commit is contained in:
2019-01-12 16:26:15 +01:00
parent efdf127033
commit 7332f87654
6 changed files with 90 additions and 8 deletions

View File

@@ -15,6 +15,41 @@
int verbosity;
/* ---------------------------------------------------------------- */
int afficheur_7segs(WINDOW * win, int lig, int col, int bits, int k)
{
int numbit, mask;
for (numbit=0; numbit<8; numbit++) {
mask = 1 << numbit;
switch(mask) {
case 0x01:
case 0x02:
case 0x04:
case 0x08:
case 0x10:
case 0x20:
case 0x40:
case 0x80:
/* decimal point */
break;
default:
fprintf(stderr, "%s mask is wrong\n", __func__);
break;
}
}
return -1;
}
/* ---------------------------------------------------------------- */

View File

@@ -33,7 +33,7 @@ char buffer[200];
tp = " DD2 MONITORING by tTh 2019 ";
if (NULL != title) tp = title;
barre_inverse('+', 0);
barre_inverse(' ', 0);
standout();
mvaddstr(0, 2, tp);
#if TRACE

View File

@@ -22,16 +22,16 @@ water = open_waterfall("premier essai", 0);
for (loop=0; loop<nbl; loop++) {
sprintf(line, "%04X %04X", loop, rand()&0xffff);
sprintf(line, "%06X %04X", loop, rand()&0xffff);
mvwaddstr(stdscr, LINES-1, 1, line);
wrefresh(stdscr);
for (foo=0; foo<4; foo++) {
if (rand()%100<42) {
rvals[foo] += 3.8*(foo + 1);
rvals[foo] += 3.9 * (foo + 1);
}
if (rvals[foo] > 1023.0) {
rvals[foo] = (float)(rand() % 15);
rvals[foo] = (float)(rand() % 25);
}
}
@@ -77,7 +77,7 @@ keypad(stdscr, TRUE); /* acces aux touches 'curseur' */
fond_ecran(" Demonstrator ");
demo(90000, 0);
demo(190000, 0);
/*
* plop, on a fini, restaurer la console