The program i made is like this, but now it goes down when the gate have stoped.
trisb = %00001111
portb = 0
main:
pause 500
if portb.0 = 1 and portb.7 = 1 then 'portb.7 switch top'
goto down 'portb.0 is the sender-
endif
if portb.0 = 1 and portb.6 = 1 then 'portb.6 switch buttom'
goto up
endif
if portb.0 = 1 and portb.7 = 0 and portb.6 = 0 then
goto down
endif
goto main
down:
pause 500
portc.0 = 1 'c0 sends the port down,
if portb.0 = 1 then
goto stopp
if portb.6 = 1 then
portc.0 = 0
goto main
endif
up:
pause 500
portc.1 = 1 'c1 sends the port up'
if portb.0 = 1 then
goto stopp
endif
if portb.7 = 1 then
portc.1 = 0
goto main
endif
stopp:
portc.0 = 0
portc.1 = 0
if portb.0 = 1 then
goto main
endif
end
Bookmarks