'******************************************* ' fichier regulation hygrometrie ' lundi 28 juillet 2003 '******************************************* 10 set picbus high 'pour transmettre a 9600 bauds au LCD display 15 lcdinit 'pour initialiser le LCD 20 dim hygro as integer, consigne as integer,h as integer, c as integer 30 hygro=adin(0) 'conversion A/D de la tension de l'hygrometre 35 h=hygro - 164 'transformation en pourcentage 36 h= h * 100 37 h= h / 643 40 consigne=adin(1) 'conversion A/D de la tension de consigne 45 c=consigne - 164 'transformation en pourcentage 46 c=c * 100 47 c=c / 643 50 delay 1000 'on attends une seonde 60 locate 0,0 'on de met au debur de la ligne 0 70 print "h=",dec(h),"%" 'on affiche l'hygrometrie en pourcent 80 locate 0,1 'on se met au debut de la ligne 1 90 print "c=",dec(c),"%" 'on affiche la consigne 100 if hygro > consigne then 'si l'hygrometir est > la consigne 110 out 14,1 'on actione le ventilateur 120 else 'sinon 130 out 14,0 'on n'actionne pas le ventilateur 140 end if 150 serout 12,103,1,0,[h,12,13,10] 'on envoie la valeur de l'hygrometrie a 9600 bauds 160 'sur la patte 15 cad le port 12 200 goto 30 'on boucle indefiniment