Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 8 A4=63 : REM I2C adresa modulu LCD-KLA, radic displeje
- 9 A5=62 : REM I2C adresa modulu LCD-KLA, radic klavesnice
- 10 Ur=2500: R1=200: R2=330: Tz=5: clock1: print using(###.##)
- 12 GOSUB 2000 : REM inicializace displeje
- 14 GOSUB 4000 : REM uvodni napis
- 20 Rb=R1*R2/(R1+R2): Ulsb=Ur/256
- 22 dim a(10) : dim b(10)
- 24 restore: for i=0 to 9 : read a(i): next i
- 30 wr_i2c 78,0: pop err: if err<>0 then 999
- 40 rd_i2c 78,D: pop err: if err<>0 then 999
- 42 rd_i2c 78,D: pop err: if err<>0 then 999
- 44 rd_i2c 78,D: pop err: if err<>0 then 999
- 50 if D=0 then print"<-oo,",Ulsb/Rb, ") mA": goto 90
- 51 print "*******************************************"
- 52 print " "
- 62 print " Vlhkost vonku "
- 70 print"od",(D*Ulsb/Rb-4)*6.25," do",((D+1)*Ulsb/Rb-4 )*6.25," %"
- 75 CMD_LCD 128+64 : POP ERR
- 76 PRINT@ "V vonku",(D*Ulsb/Rb-4)*6.25,"-",((D+1)*Ulsb/Rb-4 )*6.25," %"
- 77 PRINT@"T vonku",(D*Ulsb/Rb-4)*5.625-30,"-",((D+1)*Ulsb/Rb-4)*5.625-30
- 78 PRINT@"V dnu",(D*Ulsb/Rb-4)*6.25,"-",((D+1)*Ulsb/Rb-4)*6.25
- 79 PRINT@"T dnu",(D*Ulsb/Rb-4)*2.1875,"-",((D+1)*Ulsb/Rb-4)*2.1875
- 80 PRINT@"T okno",(D*Ulsb/Rb-4)*2.1875,"-",((D+1)*Ulsb/Rb-4)*2.1875
- 80 x=(D*Ulsb/Rb-4)*625
- 81 m=4: do: m=m-1: b(m)=0: until int(x/10**m)>0.or.m=0
- 82 for j=m to 0 step-1
- 83 y=int(x/10**j): x=x-y*10**j: b(j)=a(y) :next j
- 86 wr_i2c 56,0,119,b(3),(b(2)+128),b(1),b(0):pop err
- 88 if err<>0 then 999
- 90 T=time
- 92 if time<T+Tz then 92
- 100 wr_i2c 78,1: pop err: if err<>0 then 999
- 110 rd_i2c 78,D: pop err: if err<>0 then 999
- 112 rd_i2c 78,D: pop err: if err<>0 then 999
- 114 rd_i2c 78,D: pop err: if err<>0 then 999
- 120 if D=0 then print"<-oo,",Ulsb/Rb, ") mA": goto 148
- 121 print "*******************************************"
- 122 print " "
- 124 print " Teplota vonku "
- 130 print"od",(D*Ulsb/Rb-4)*5.625-30,"do",((D+1)*Ulsb/Rb-4)*5.625-30," Celz"
- 131 x=((D*Ulsb/Rb-4)*5.625-30)*100
- 132 m=4: do: m=m-1: b(m)=0: until int(x/10**m)>0.or.m=0
- 133 for j=m to 0 step-1
- 134 y=int(x/10**j): x=x-y*10**j: b(j)=a(y):next j
- 135 wr_i2c 56,0,119,b(3),(b(2)+128),b(1),b(0):pop err
- 136 if err<>0 then 999
- 139 CMD_LCD 128+64 : POP ERR
- 140 PRINT@"T vonku",(D*Ulsb/Rb-4)*5.625-30,"-",((D+1)*Ulsb/Rb-4)*5.625-30
- 141 goto 77
- 148 T=time
- 150 if time<T+Tz then 150
- 160 wr_i2c 78,10: pop err: if err<>0 then 999
- 170 rd_i2c 78,D: pop err: if err<>0 then 999
- 172 rd_i2c 78,D: pop err: if err<>0 then 999
- 174 rd_i2c 78,D: pop err: if err<>0 then 999
- 180 if D=0 then print"<-oo,",Ulsb/Rb, ") mA": goto 200
- 181 print "*******************************************"
- 182 print " "
- 184 print " Vlhkost v TPAR "
- 190 print"od",(D*Ulsb/Rb-4)*6.25,"do",((D+1)*Ulsb/Rb-4)*6.25," %"
- 191 x=(D*Ulsb/Rb-4)*625
- 192 m=4: do: m=m-1: b(m)=0: until int(x/10**m)>0.or.m=0
- 193 for j=m to 0 step-1
- 194 y=int(x/10**j): x=x-y*10**j: b(j)=a(y):next j
- 195 wr_i2c 56,0,119,b(3),(b(2)+128),b(1),b(0):pop err
- 196 if err<>0 then 999
- 197 CMD_LCD 128+64 : POP ERR
- 198 PRINT@"V dnu",(D*Ulsb/Rb-4)*6.25,"-",((D+1)*Ulsb/Rb-4)*6.25
- 200 T=time
- 210 if time<T+Tz then 210
- 300 wr_i2c 78,11: pop err: if err<>0 then 999
- 310 rd_i2c 78,D: pop err: if err<>0 then 999
- 312 rd_i2c 78,D: pop err: if err<>0 then 999
- 314 rd_i2c 78,D: pop err: if err<>0 then 999
- 320 if D=0 then print"<-oo,",Ulsb/Rb, ") mA": goto 340
- 321 print "*******************************************"
- 322 print " "
- 332 print " Teplota v TPAR - OKNO"
- 334 print"od",(D*Ulsb/Rb-4)*2.1875," do ",((D+1)*Ulsb/Rb-4)*2.1875," Celz"
- rem 336 print D,(D*Ulsb/Rb-4)*2.1875," - ",((D+1)*Ulsb/Rb-4)*2.1875," Celz"
- 340 x=(D*Ulsb/Rb-4)*2.1875*100
- 341 m=4: do: m=m-1: b(m)=0: until int(x/10**m)>0.or.m=0
- 342 for j=m to 0 step-1
- 343 y=int(x/10**j): x=x-y*10**j: b(j)=a(y):next j
- 344 wr_i2c 56,0,119,b(3),(b(2)+128),b(1),b(0):pop err
- 345 if err<>0 then 999
- 346 CMD_LCD 128+64 : POP ERR
- 347 PRINT@"T okno",(D*Ulsb/Rb-4)*2.1875,"-",((D+1)*Ulsb/Rb-4)*2.1875
- 350 T=time
- 360 if time<T+Tz then 360
- 400 wr_i2c 79,0: pop err: if err<>0 then 999
- 410 rd_i2c 79,D: pop err: if err<>0 then 999
- 412 rd_i2c 79,D: pop err: if err<>0 then 999
- 414 rd_i2c 79,D: pop err: if err<>0 then 999
- 450 if D=0 then print"<-oo,",Ulsb/Rb, ") mA": goto 490
- 451 print "*******************************************"
- 452 print " "
- 462 print " Teplota v TPAR - ROH"
- rem 464 print D,(D*Ulsb/Rb-4)*2.1875,"-",((D+1)*Ulsb/Rb-4)*2.1875," Celz"
- 470 print"od",(D*Ulsb/Rb-4)*2.1875,"do",((D+1)*Ulsb/Rb-4)*2.1875," Celz"
- 471 x=(D*Ulsb/Rb-4)*2.1875*100
- 472 m=4: do: m=m-1: b(m)=0: until int(x/10**m)>0.or.m=0
- 473 for j=m to 0 step-1
- 474 y=int(x/10**j): x=x-y*10**j: b(j)=a(y):next j
- 475 wr_i2c 56,0,119,b(3),(b(2)+128),b(1),b(0):pop err
- 476 if err<>0 then 999
- 477 CMD_LCD 128+64 : POP ERR
- 478 PRINT@"T dnu",(D*Ulsb/Rb-4)*2.1875,"-",((D+1)*Ulsb/Rb-4)*2.1875
- 480 data 63,6,91,79,102,109,125,39,127,111
- 490 T=time
- 492 if time<T+Tz then 492 else 24
- 999 print "chyba"
- 2000 REM ************** inicializace displeje ******************
- 2010 DBY(36)=DBY(36).OR.128
- 2020 CMD_LCD 51,50,40,12,6,1 : POP ERR : REM kurzor vypnut
- 2030 REM definovani vlastnich znaku
- 2040 CMD_LCD 64 : POP ERR : RESTORE
- 2050 FOR A=1 TO 48
- 2060 READ B : PRINT @CHR(B),
- 2070 NEXT A
- 2080 DATA 2,4,14,1,15,17,15,0 : REM chr(0)=a+carka
- 2090 DATA 2,4,14,17,31,16,15,0 : REM chr(1)=e+carka
- 2100 DATA 2,4,12,4,4,4,14,0 : REM chr(2)=i+carka
- 2110 DATA 10,4,14,16,16,17,14,0 : REM chr(3)=c+hacek
- 2120 DATA 10,4,14,16,14,1,30,0 : REM chr(4)=s+hacek
- 2130 DATA 10,4,22,25,16,16,16,0 : REM chr(5)=r+hacek
- 2140 RETURN
- 3500 REM ***************** ceka 1 sekundu **********************
- 3510 T=TIME
- 3520 IF TIME<T+1 THEN 3520
- 3530 RETURN
- 4000 REM ************* uvodni napis na displej *****************
- 4010 CMD_LCD 1 : POP ERR
- 4020 PRINT @"Meteo stanica",
- 4030 CMD_LCD 128+64 : POP ERR
- 4040 PRINT @" meteo-st .UCB52",
- 4050 GOSUB 3500 : GOSUB 3500
- 4060 RETURN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement