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