home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1994 January / 64er_Magazin_94-01_1994_Markt__Technik_de.d64 / schnee-indikator (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  5KB  |  159 lines

  1. 10 rem *****************************
  2. 20 rem * schnee-gesteuerter wecker *
  3. 30 rem *****************************
  4. 35 :
  5. 40 rem nikolaus heusler
  6. 42 rem zwengauerweg 18
  7. 44 rem 81479 solln
  8. 48 :
  9. 49 rem (c) markt & technik 1993-1994
  10. 50 rem
  11. 60 rem userport-belegung:
  12. 70 rem  pb0: 1=heiz-relais an
  13. 80 rem  pb1: 1=schnee auf sensor
  14. 90 rem  pb2: 1=weck-relais an
  15. 100 rem
  16. 120 run1000
  17. 200 rem zeit-eingabe ---------------
  18. 210 c=0
  19. 220 r=peek(209)+peek(210)*256+peek(211)
  20. 230 print""left$(z$,2)":"mid$(z$,3,2)":"right$(z$,2)"[157][157][157][157][157][157][157][157]";
  21. 240 rr=r+c-(c>1)-(c>3):pokerr,128+peek(rr)
  22. 250 geta$:ifa$=chr$(13)then300
  23. 260 ifa$=""andc<5thenpokerr,peek(rr)and127:c=1+c:goto240
  24. 270 if(a$=chr$(20)ora$="[157]")andc>.thenpokerr,peek(rr)and127:c=c-1:goto240
  25. 280 ifa$<"0"ora$>"9"then250
  26. 290 z$=left$(z$,c)+a$+mid$(z$,c+2):c=c+1+(c>4):goto230
  27. 300 ifval(left$(z$,2))>23orval(mid$(z$,3,2))>59orval(right$(z$,2))>59then220
  28. 310 pokerr,peek(rr)and127:print"[158]":return
  29. 400 rem weckruf --------------------
  30. 402 poke54296,15:poke54280,200:poke54279,100:poke54284,9:poke54285,240
  31. 404 poke54273,200:poke54277,9:poke54278,240:fore=1to2
  32. 406 ford=1to3:poke54276,17:poke54283,17:fork=0to24:next:poke54276,16
  33. 408 poke54283,16:fork=0to40:nextk,d:fork=0to100:nextk,e
  34. 410 return
  35. 500 rem -------------------------------
  36. 510 rem hauptprogramm -----------------
  37. 1000 sys65409:poke53280,.:poke53281,.:poke648,4:poke54296,.
  38. 1010 print"[158][147]der 64'er-schnee-wecker         [158]nh/11.93
  39. 1020 [153]"terminal arbeitet - gleich geht's weiter
  40. 1022 fori=1to4:a$=a$+chr$(peek(49151+i)):next:ifa$="nh93"then1200
  41. 1024 print"dauer: ca. 30 sekunden pause
  42. 1030 [129]i[178]0[164]9:[135]f$:d$[178]"
  43. 1031 data1110111,0010010,1011101,1011011,0111010
  44. 1032 data1101011,0101111,1110010,1111111,1111011
  45. 1033 forj=1to7:ifmid$(f$,j,1)="0"then1048
  46. 1034 ifj=1thend$="   [146][157][157][157][157]
  47. 1036 [139]j[178]2[167]d$[178]d$[170]" cmd cmd cmd ononononcmd
  48. 1038 ifj=3thend$=d$+" [157] [157] [157] [145][145][145][145][157][157][157][157][157]
  49. 1040 [139]j[178]4[167]d$[178]d$[170]"   waitcmdcmdcmdcmdononononon
  50. 1042 ifj=5thend$=d$+" [157] [157] [157] [157][145][145][145][145][145][145][145][145][145]
  51. 1044 [139]j[178]6[167]d$[178]d$[170]" cmd cmd cmd onononononononononcmdcmdcmdcmdcmd
  52. 1046 ifj=7thend$=d$+"   [157][157][157][157][145][145][145][145][145][145][145][145][145][145]
  53. 1048 [130]:d$[178]d$[170]"wait"[170][199](0)
  54. 1050 [129]j[178]1[164][195](d$)
  55. 1052 [151]49151[170](1[170]i)[172]256[170]j,[198]([202](d$,j)):[130]j,i
  56. 1100 [131]160,,132,2,177,2,240,6,32,210,255,200,208,246,96,169,,133,2,133,4,169
  57. 1102 [131]204,133,3,169,4,133,5,160,,177,2,145,4,230,2,208,2,230,3,230,4,208,2
  58. 1104 [131]230,5,165,4,201,224,208,234,165,5,201,5,144,228,96,169,32,162,,157,,204
  59. 1105 [131]157,,205,232,208,247,96
  60. 1106 s[178]0:[129]i[178]49185[164]49258:[135]q:s[178]s[170]q:[151]i,q:[130]
  61. 1108 [139]s[177][179]8818[167][153]"datenfehler!":[144]
  62. 1110 [151]49152,78:[151]49153,72:[151]49154,57:[151]49155,51
  63. 1200 [153]"bitte geben sie die uhrzeiten im for-
  64. 1202 print"mat hh:mm:ss ein und betaetigen <return>
  65. 1204 z$[178]ti$:[143] aktuelle zeit default
  66. 1206 [153]"wie spaet ist es jetzt? ...... ";
  67. 1208 [141]200:ti$[178]z$
  68. 1210 z$[178]"210000":[143] heizung ein default
  69. 1212 [153]"wann soll die heizung fuer den
  70. 1214 print"sensor eingeschaltet werden?   ";
  71. 1216 gosub200:u1$=z$
  72. 1220 z$="043000":rem weckzeit 1 default
  73. 1222 print"weckzeit, falls schnee ge-
  74. 1224 [153]"fallen ist? .................. ";
  75. 1226 [141]200:u2$[178]z$
  76. 1230 z$[178]"073000":[143] weckzeit 2 default
  77. 1232 [153]"weckzeit, falls kein schnee
  78. 1234 print"gefallen ist? ................ ";
  79. 1236 gosub200:u3$=z$
  80. 2000 print"[158][147]";
  81. 2001 print"[158]weckz.1: "left$(u2$,2)":"mid$(u2$,3,2)":"right$(u2$,2)
  82. 2002 print"[158]weckz.2: "left$(u3$,2)":"mid$(u3$,3,2)":"right$(u3$,2)
  83. 2004 print"[158]heiz.  : "left$(u1$,2)":"mid$(u1$,3,2)":"right$(u1$,2)
  84. 2006 print"[145][145][145][158]"tab(18)"  status:           [160]
  85. 2008 [153][163]18)" wait heizung:
  86. 2010 printtab(18)" [146] schnee :
  87. 2012 [153][163]18)" wait alarm  :
  88. 2013 printtab(18)" [146]
  89. 2014 [153][163]18)" wait sensor beheizt  :
  90. 2016 printtab(18)" [146] weckz.1 erreicht:
  91. 2018 [153][163]18)" wait weckz.2 erreicht:
  92. 2020 printtab(18)" [146] programm laeuft :
  93. 2022 [153][163]18)" wait fertig          :
  94. 2024 printtab(18)" [146]
  95. 2026 [153][163]18)"                    closeonononononon
  96. 2028 r$(0)=" ":r$(1)="[209]
  97. 2030 [153]"neustart mit
  98. 2032 print"taste ^[146][165]
  99. 2034 [153]"abbruch mit
  100. 2036 print"taste _[146][165]
  101. 2040 p[178]56577:[151]p[170]2,5:[143] ddr
  102. 2042 [151]p,0:[143] relais aus
  103. 2044 fl[178]0:[143] wecker war noch nicht ein
  104. 2046 mf[178]0:[143] screensaver init
  105. 2100 [151]648,204:[158]49245:[153]"
  106. 2102 t$=ti$:fori=1to6:poke3,val(mid$(t$,i,1))+193:sys49185
  107. 2104 ifi=2ori=4thenprint"";
  108. 2108 next:poke648,4:sys49200
  109. 2112 print""spc(12)"[158] [146]"spc(13)"[158] [146]
  110. 2114 [153]""[166]12)"sys wait"[166]13)"sys wait
  111. 2120 poke214,14:sys58732
  112. 2122 w$="aus":if(peek(p)and1)thenw$="ein
  113. 2124 [153][163]29)w$
  114. 2126 w$[178]"keiner":[139]([194](p)[175]2)[167]w$[178]"vorhanden
  115. 2128 printtab(29)w$
  116. 2130 wk=.:w$="aus":if(peek(p)and4)thenwk=1:w$="ein
  117. 2132 [153][163]29)w$:[139]wk[167][141]400
  118. 2134 [153]""[163]38)r$(qq):qq[178]1[171]qq
  119. 2200 [143] heizung einschalten ---------
  120. 2202 [139]ti$[179][177]u1$[167]2300
  121. 2204 [151]p,[194](p)[176]1:[143] heizung an
  122. 2300 [143] heizung ausschalten ---------
  123. 2301 [143] nur, falls kein schnee mehr vorhanden
  124. 2302 [139](([194](p)[175]2)[178]1)[176]([194](p)[175]1)[178]0[167]2400
  125. 2304 [151]p,[194](p)[175]254:[143] heizung aus
  126. 2306 [151]214,18:[158]58732:[153][163]38)"(NULL)
  127. 2400 rem weckzeit 1 ------------------
  128. 2402 ifti$<>u2$then2500
  129. 2403 poke214,19:sys58732:printtab(38)"[209]
  130. 2404 [139]fl[167]2500
  131. 2405 [143] wecken, falls schnee
  132. 2406 [139]([194](p)[175]2)[178]0[167]2500:[143] weiterschlafen...
  133. 2408 [141]3000:[143] wecker an
  134. 2500 [143] weckzeit 2 ------------------
  135. 2502 [139]ti$[179][177]u3$[167]2600
  136. 2503 [151]214,20:[158]58732:[153][163]38)"(NULL)
  137. 2504 ifflthen2600
  138. 2506 gosub3000:rem wecker ein
  139. 2600 rem screen-saver ----------------
  140. 2602 ifmf=100then2700
  141. 2604 ifpeek(p)and4thenmf=0:goto2700:rem nur falls kein alarm
  142. 2606 mf=mf+1:ifmf<20then2700
  143. 2608 poke53265,43:rem bildschirm aus
  144. 2610 mf=100
  145. 2700 rem tastendruck auswerten -------
  146. 2702 geta$:ifa$=""then2800
  147. 2704 poke53265,27:rem bildschirm ein
  148. 2706 mf=0:rem screen-saver init
  149. 2708 ifpeek(p)and4thenpoke214,22:sys58732:printtab(38)"[209]
  150. 2710 [151]p,[194](p)[175]251:[143] wecker aus
  151. 2712 [139]a$[178]"_"[167][138]
  152. 2714 [139]a$[178]"^"[167]2000
  153. 2800 [137]2100
  154. 3000 [143] wecker an -------------------
  155. 3002 fl[178]1:[143] weckflag
  156. 3004 [151]53265,27:[143] bildschirm an
  157. 3006 [151]p,[194](p)[176]4:[143] wecker ein
  158. 3008 [142]
  159.