anyway, the reason for your subroutine not working is becuase this statement will never be true: "if yy=2 and portb.7=0 then", becuase you only jump to the subroutine when portb.7=1.
Instead of this:
if portb.7=1 then
gosub flipflop
endif
Try just this: "gosub flipflop"
Also, there is no return from the subroutine... instead of "goto start", put "return"




Bookmarks