1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
| '*********************************************************
' Programme de mise en oeuvre d'un CB405, EZL 50, DS1620 *
'*********************************************************
'Partie declarations
Const Device = CB405
Delay 100
Opencom 2,19200,3,512,512
Delay 100
Set Display 2,0,0,50
Delay 100
Set I2c 45, 44
Dim a As Integer
Const iorst = 5 'Broche Reset du Thermometre DS1620
Const ioclk = 6 'Broche Clock du Thermometre DS1620
Const iodq = 27 'Broche Data du Thermometre DS1620
Dim temp As Integer
Dim RS232_C2 As String 'Carte reseau
Dim ADC0 As Integer
Cls
Delay 1000
Do
- 'Partie acquisition Temperature
High iorst
Shiftout ioclk,iodq,0,12,8
Shiftout ioclk,iodq,0,3,8
Low iorst
High iorst
Shiftout ioclk,iodq,0,&hEE,8
Low iorst
High iorst
Shiftout ioclk,iodq,0,&haa,8
temp = Shiftin(ioclk,iodq,4,9)
temp = temp
temp = temp/2.5
Low iorst
Delay 100
'Partie acquisition entrees analogiques
ADC0 = Tadin(0)
Delay 200
Locate 0,0
Print "In ADC0 =", Dec4 ADC0
Delay 200
Locate 0,1
Print "In Temp = ", Dec3 temp
Delay 200
- 'Partie HTTP
If Blen(2,0)>0 Then
Delay 100
RS232_C2 = Getstr(2,255)
Delay 1000
If Left(RS232_C2,16) = "GET /?Sortie1=On" Then
a=Outstat(32)
If a=0 Then
High 32
Locate 0,2
Print "Out ADC8 = On "
Beep 7,300
Endif
Endif
If Left(RS232_C2,16) = "GET /?Sortie1=Of" Then
a=Outstat(32)
If a=1 Then
Low 32
Locate 0,2
Print "Out ADC8 = Off"
Beep 7,100
Endif
Endif
If Left(RS232_C2,5) = "GET /" Then
Putstr 2, "HTTP/1.1 200 OK", 13, 10
Delay 100
Putstr 2, "Connection : Close", 13, 10
Delay 100
Putstr 2, "Content-type : text/HTML", 13, 10
Delay 100
Putstr 2, "Contet-Length : 512", 13, 10
Delay 100
Putstr 2, 10,13
Delay 100
'Partie XHTML
Putstr 2, "<!DOCTYPE html PUBLIC &h22;-//W3C//DTD XHTML 1.0 Strict//EN&h22; &h22;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&h22;>", 10, 13
Putstr 2, "<html xmlns=&h22;<a href="http://www.w3.org/1999/xhtml&h22;" target="_blank">http://www.w3.org/1999/xhtml&h22;</a> xml:lang=&h22;fr&h22;>", 10, 13
Putstr 2, "<head><meta http-equiv=&h22;Content-type&h22; content=&h22;text/html; charset=utf-8&h22; /><title>Site de Fahim IKKEN</title></head>",10,13
Delay 200
Putstr 2, "<body><h1>Mesure & Commande Via Internet</h1><form name=formulaire method=post,>Etat de la sortie P32:<Input type=radio name=Sortie1 value=On>On<Input type=radio name=Sortie1 value=Off>Off<br><Input type=submit name=Bouton value=Envoyer></form></body></html>",10,13
Delay 200
Endif
Endif
Loop |
Partager