Advertisement
Guest User

Untitled

a guest
Jul 30th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. 8     A4=63 :  REM I2C adresa modulu LCD-KLA, radic displeje
  3. 9     A5=62 :  REM I2C adresa modulu LCD-KLA, radic klavesnice
  4. 10 Ur=2500: R1=200: R2=330: Tz=5: clock1: print using(###.##)
  5. 12    GOSUB 2000 :  REM inicializace displeje
  6. 14    GOSUB 4000 :  REM uvodni napis
  7. 20 Rb=R1*R2/(R1+R2): Ulsb=Ur/256
  8. 22 dim a(10) : dim b(10)
  9. 24 restore: for i=0 to 9 : read a(i): next i
  10. 30 wr_i2c 78,0: pop err: if err<>0 then 999
  11. 40 rd_i2c 78,D: pop err: if err<>0 then 999
  12. 42 rd_i2c 78,D: pop err: if err<>0 then 999
  13. 44 rd_i2c 78,D: pop err: if err<>0 then 999
  14. 50 if D=0 then print"<-oo,",Ulsb/Rb, ") mA": goto 90
  15. 51 print "*******************************************"
  16. 52 print " "
  17. 62 print "  Vlhkost  vonku "
  18. 70 print"od",(D*Ulsb/Rb-4)*6.25,"  do",((D+1)*Ulsb/Rb-4 )*6.25,"  %"
  19.  
  20. 75   CMD_LCD 128+64 :  POP ERR
  21.  
  22. 76   PRINT@ "V vonku",(D*Ulsb/Rb-4)*6.25,"-",((D+1)*Ulsb/Rb-4 )*6.25," %"
  23. 77   PRINT@"T vonku",(D*Ulsb/Rb-4)*5.625-30,"-",((D+1)*Ulsb/Rb-4)*5.625-30
  24. 78   PRINT@"V dnu",(D*Ulsb/Rb-4)*6.25,"-",((D+1)*Ulsb/Rb-4)*6.25
  25. 79   PRINT@"T dnu",(D*Ulsb/Rb-4)*2.1875,"-",((D+1)*Ulsb/Rb-4)*2.1875
  26. 80   PRINT@"T okno",(D*Ulsb/Rb-4)*2.1875,"-",((D+1)*Ulsb/Rb-4)*2.1875
  27.  
  28.  
  29.  
  30.  
  31.  
  32. 80 x=(D*Ulsb/Rb-4)*625
  33. 81 m=4: do: m=m-1: b(m)=0: until int(x/10**m)>0.or.m=0
  34. 82 for j=m to 0 step-1
  35. 83  y=int(x/10**j): x=x-y*10**j:  b(j)=a(y) :next j
  36. 86 wr_i2c 56,0,119,b(3),(b(2)+128),b(1),b(0):pop err
  37. 88 if err<>0 then 999
  38. 90 T=time
  39. 92 if time<T+Tz then 92
  40.  
  41. 100 wr_i2c 78,1: pop err:    if err<>0 then 999
  42. 110 rd_i2c 78,D: pop err: if err<>0 then 999
  43. 112 rd_i2c 78,D: pop err: if err<>0 then 999
  44. 114 rd_i2c 78,D: pop err: if err<>0 then 999
  45. 120 if D=0 then print"<-oo,",Ulsb/Rb, ") mA": goto 148
  46. 121 print "*******************************************"
  47. 122 print " "
  48.  
  49. 124 print " Teplota  vonku "
  50. 130 print"od",(D*Ulsb/Rb-4)*5.625-30,"do",((D+1)*Ulsb/Rb-4)*5.625-30," Celz"
  51.  
  52. 131 x=((D*Ulsb/Rb-4)*5.625-30)*100
  53. 132 m=4: do: m=m-1: b(m)=0: until int(x/10**m)>0.or.m=0
  54. 133 for j=m to 0 step-1
  55. 134 y=int(x/10**j): x=x-y*10**j: b(j)=a(y):next j
  56. 135 wr_i2c 56,0,119,b(3),(b(2)+128),b(1),b(0):pop err
  57. 136 if err<>0 then 999
  58.  
  59. 139   CMD_LCD 128+64 :  POP ERR
  60. 140   PRINT@"T vonku",(D*Ulsb/Rb-4)*5.625-30,"-",((D+1)*Ulsb/Rb-4)*5.625-30
  61. 141 goto 77
  62.  
  63. 148 T=time
  64. 150 if time<T+Tz then 150
  65. 160 wr_i2c 78,10: pop err: if err<>0 then 999
  66. 170 rd_i2c 78,D: pop err: if err<>0 then 999
  67. 172 rd_i2c 78,D: pop err: if err<>0 then 999
  68. 174 rd_i2c 78,D: pop err: if err<>0 then 999
  69. 180 if D=0 then print"<-oo,",Ulsb/Rb, ") mA": goto 200
  70. 181 print "*******************************************"
  71. 182 print " "
  72. 184 print "  Vlhkost  v TPAR "
  73. 190 print"od",(D*Ulsb/Rb-4)*6.25,"do",((D+1)*Ulsb/Rb-4)*6.25," %"
  74.  
  75. 191 x=(D*Ulsb/Rb-4)*625
  76. 192 m=4: do: m=m-1: b(m)=0: until int(x/10**m)>0.or.m=0
  77. 193 for j=m to 0 step-1
  78. 194 y=int(x/10**j): x=x-y*10**j: b(j)=a(y):next j
  79. 195 wr_i2c 56,0,119,b(3),(b(2)+128),b(1),b(0):pop err
  80. 196 if err<>0 then 999
  81.  
  82. 197   CMD_LCD 128+64 :  POP ERR
  83. 198   PRINT@"V dnu",(D*Ulsb/Rb-4)*6.25,"-",((D+1)*Ulsb/Rb-4)*6.25
  84.  
  85.  
  86.  
  87.  
  88. 200 T=time
  89. 210 if time<T+Tz then 210
  90.  
  91. 300 wr_i2c 78,11: pop err: if err<>0 then 999
  92. 310 rd_i2c 78,D: pop err: if err<>0 then 999
  93. 312 rd_i2c 78,D: pop err: if err<>0 then 999
  94. 314 rd_i2c 78,D: pop err: if err<>0 then 999
  95. 320 if D=0 then print"<-oo,",Ulsb/Rb, ") mA": goto 340
  96. 321 print "*******************************************"
  97. 322 print " "
  98. 332 print " Teplota  v TPAR - OKNO"
  99. 334 print"od",(D*Ulsb/Rb-4)*2.1875," do ",((D+1)*Ulsb/Rb-4)*2.1875,"  Celz"
  100. rem 336 print D,(D*Ulsb/Rb-4)*2.1875," - ",((D+1)*Ulsb/Rb-4)*2.1875," Celz"
  101.  
  102. 340 x=(D*Ulsb/Rb-4)*2.1875*100
  103. 341 m=4: do: m=m-1: b(m)=0: until int(x/10**m)>0.or.m=0
  104. 342 for j=m to 0 step-1
  105. 343 y=int(x/10**j): x=x-y*10**j: b(j)=a(y):next j
  106. 344 wr_i2c 56,0,119,b(3),(b(2)+128),b(1),b(0):pop err
  107. 345 if err<>0 then 999
  108.  
  109. 346   CMD_LCD 128+64 :  POP ERR
  110. 347   PRINT@"T okno",(D*Ulsb/Rb-4)*2.1875,"-",((D+1)*Ulsb/Rb-4)*2.1875
  111.  
  112. 350 T=time
  113. 360 if time<T+Tz then 360  
  114.  
  115. 400 wr_i2c 79,0: pop err: if err<>0 then 999
  116. 410 rd_i2c 79,D: pop err: if err<>0 then 999
  117. 412 rd_i2c 79,D: pop err: if err<>0 then 999
  118. 414 rd_i2c 79,D: pop err: if err<>0 then 999
  119. 450 if D=0 then print"<-oo,",Ulsb/Rb, ") mA": goto 490
  120. 451 print "*******************************************"
  121. 452 print " "
  122. 462 print " Teplota  v TPAR  - ROH"
  123. rem 464 print D,(D*Ulsb/Rb-4)*2.1875,"-",((D+1)*Ulsb/Rb-4)*2.1875," Celz"
  124.  
  125. 470 print"od",(D*Ulsb/Rb-4)*2.1875,"do",((D+1)*Ulsb/Rb-4)*2.1875," Celz"
  126.  
  127. 471 x=(D*Ulsb/Rb-4)*2.1875*100
  128. 472 m=4: do: m=m-1: b(m)=0: until int(x/10**m)>0.or.m=0
  129. 473 for j=m to 0 step-1
  130.  
  131. 474 y=int(x/10**j): x=x-y*10**j: b(j)=a(y):next j
  132. 475 wr_i2c 56,0,119,b(3),(b(2)+128),b(1),b(0):pop err
  133. 476 if err<>0 then 999
  134.  
  135. 477   CMD_LCD 128+64 :  POP ERR
  136. 478   PRINT@"T dnu",(D*Ulsb/Rb-4)*2.1875,"-",((D+1)*Ulsb/Rb-4)*2.1875
  137.  
  138. 480 data 63,6,91,79,102,109,125,39,127,111  
  139.  
  140. 490 T=time
  141. 492 if time<T+Tz then 492 else 24
  142.  
  143.  
  144.  
  145. 999 print "chyba"
  146.  
  147.  
  148. 2000   REM ************** inicializace displeje ******************
  149. 2010  DBY(36)=DBY(36).OR.128
  150. 2020   CMD_LCD 51,50,40,12,6,1 :  POP ERR :  REM kurzor vypnut
  151. 2030   REM definovani vlastnich znaku
  152. 2040   CMD_LCD 64 :  POP ERR :  RESTORE
  153. 2050   FOR A=1 TO 48
  154. 2060   READ B :  PRINT @CHR(B),
  155. 2070   NEXT A
  156. 2080   DATA 2,4,14,1,15,17,15,0 :  REM chr(0)=a+carka
  157. 2090   DATA 2,4,14,17,31,16,15,0 :  REM chr(1)=e+carka
  158. 2100   DATA 2,4,12,4,4,4,14,0 :  REM chr(2)=i+carka
  159. 2110   DATA 10,4,14,16,16,17,14,0 :  REM chr(3)=c+hacek
  160.     2120   DATA 10,4,14,16,14,1,30,0 :  REM chr(4)=s+hacek
  161. 2130   DATA 10,4,22,25,16,16,16,0 :  REM chr(5)=r+hacek
  162. 2140   RETURN
  163.  
  164. 3500   REM ***************** ceka 1 sekundu **********************
  165. 3510  T=TIME
  166. 3520   IF TIME<T+1 THEN 3520
  167. 3530   RETURN
  168.  
  169. 4000   REM ************* uvodni napis na displej *****************
  170. 4010   CMD_LCD 1 :  POP ERR
  171. 4020   PRINT @"Meteo stanica",
  172. 4030   CMD_LCD 128+64 :  POP ERR
  173. 4040   PRINT @" meteo-st .UCB52",
  174. 4050   GOSUB 3500 :  GOSUB 3500
  175. 4060   RETURN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement