I dont understand what all this stuff with yy is for.
Why not use something like this:
Code:if portb.7=1 then ' If button is pressed: toggle portb.1 ' Toggle the LED loop: if portb.7=1 then goto loop ' Wait until the button is released endif
I dont understand what all this stuff with yy is for.
Why not use something like this:
Code:if portb.7=1 then ' If button is pressed: toggle portb.1 ' Toggle the LED loop: if portb.7=1 then goto loop ' Wait until the button is released endif
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"
Last edited by Kamikaze47; - 22nd November 2005 at 10:10.
Bookmarks