This is confusing.
Code:
Initial:
if ign=1 then
goto initial
else
Initiall:
if x=0 then
serin ign, 2, 600, setmaster, ["~"], module
goto setmaster
else
pause 50
seroutrpt:
if a<=5 then 'sends serout command 5 times
serout OUT, 2,["~",module]
a=a+1
goto seroutrpt
endif
trisb.1=1 'makes out and input temporarly
trisb.0=0 'makes ign and output temporarly
ign=0 'sends ground pulse to previous slave for slave count
pause 50
ign=1 'idles pulse
goto waitcnt
endif
endif
You can do simple IF for first test:
Code:
Initial:
if ign=1 then
goto initial
endif
Initiall:
if x=0 then
serin ign, 2, 600, setmaster, ["~"], module
goto setmaster
else
pause 50
seroutrpt:
if a<=5 then 'sends serout command 5 times
serout OUT, 2,["~",module]
a=a+1
goto seroutrpt
endif
trisb.1=1 'makes out and input temporarly
trisb.0=0 'makes ign and output temporarly
ign=0 'sends ground pulse to previous slave for slave count
pause 50
ign=1 'idles pulse
goto waitcnt
endif
There are other ways to make constant loops too (WHILE-WEND for example).
It would definitely help if you posted all your code.
(I'm still digesting the rest of the logic, bit confusing for me)
Robert
Bookmarks