Ako hoćeš tako jednostavno....
Prijem
Code:
TRISA=%00001 'PORTA.0 HABERLES,ME HATTI VAR GI.RI.S,
TRISB=0 'PORTB TAMAMI C,IKIS,
PORTA=0 'PORTA I.C,ERI.G(I. SIFIRLA
PORTB=0 'PORTB I.C,ERI.G(NI. SIFIRLA
'*****DEG(I.S,KENLERI. TANIMLA*****
AL VAR BYTE 'BYTE CI.NSI.NDEN TANIMLAMA
GIRIS VAR PORTA.0
SYMBOL LEDA=PORTB.0
SYMBOL LEDB=PORTB.1
SYMBOL LEDC=PORTB.2
SYMBOL LEDD=PORTB.3
SYMBOL LEDE=PORTB.4
SYMBOL LEDF=PORTB.5
SYMBOL LEDG=PORTB.6
SYMBOL LEDH=PORTB.7
CLEAR 'BU"TU"N DEG(I.S,KENLERI. SIFIRLA
PAUSE 500 '500MS BEKLE
PORTB=0
BASLA:
SERIN2 GIRIS,396,[WAIT("PBP"),AL]
PORTB=~AL ' ako su LED na masi ako su na VCC onda bez ~
pause 100
goto BASLA
END
Predaja
Code:
'*****GI.RI.S, VE C,IKIS,LAR*****
TRISA=0 'PORTA TAMAMI C,IKIS,
TRISB=$FF 'PORTB TAMAMI GI.RI.S,
PORTA=0 'PORTA I.C,ERI.G(I.NI. SIFIRLA
PORTB=0 'PORTB I.C,ERI.G(I.NI. SIFIRLA
OPTION_REG.7=0 'PULL UP DI.RENC,ERI.NI. KULLANMAYA GEREK YOK
'*****DEG(I.S,KENLERI. TANIMLA*****
SYMBOL CIKIS=PORTA.0 'HABERLES,ME HATTI
SYMBOL TUSA=PORTB.0 'TUS A
SYMBOL TUSB=PORTB.1 'TUS B
SYMBOL TUSC=PORTB.2 'TUS C
SYMBOL TUSD=PORTB.3
SYMBOL TUSE=PORTB.4
SYMBOL TUSF=PORTB.5
SYMBOL TUSG=PORTB.6
SYMBOL TUSH=PORTB.7
VER VAR BYTE 'BYTE CI.NSI.NDEN TANIMLAMA
PAUSE 500 '500MS BEKLE
VER=0 'I.C,ERI.G(I. SIFIRLA
BASLA:
VER=PORTB
gosub GONDER
PAUSE 100
GOTO BASLA 'BASLA ADRESI.NE GI.T
GONDER:
SEROUT2 CIKIS,396,["P","B","P",VER]
SEROUT2 CIKIS,396,["P","B","P",VER]
SEROUT2 CIKIS,396,["P","B","P",VER]
SEROUT2 CIKIS,396,["P","B","P",VER]
RETURN
END