datap var porta.0
dir var porta.1 'dir = 1 then output, dir = 0 onda unosa
led1 var portb.0
led2 var portb.1
veri var byte
Baud con 84'9600, N, 8,1start:
trisa = 1
trisb = 0
led1 = 0
led2 = 0
glavni:
dir = 0
serin2 datap, Baud, 100, glavni, [veri]
led1 = 1
stanka 150
led1 = 0
'
ako veri = "X", a zatim
led2 = 1
stanka 150
led2 = 0
endif
goto glavni
datap var porta.0
dir var porta.1 'dir = 1 then output, dir = 0 onda unosa
buton var portb.0
vodio var portb.1
veri var byte
Baud con 84'9600, N, 8,1start:
trisa = 0
trisb = 1
vodio = 0
glavni:
ako buton = 1 then
poziv rs485_send
endif
stanka 150
goto glavnirs485_send:
vodio = 1
dir = 1
serout2 datap, Baud, [ "X"]
vodio = 0
povratak
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.