Off the top of my head in pseudo-code:
RobertCode:SwitchIn VAR PortB.0 OldState VAR BIT SwitchState VAR BIT OldState = SwitchIn SwitchState = 0 Main: IF SwitchIn not = OldState THEN SwitchState = SwitchState ^ %1 ' Switch has been toggled OldState = SwitchIn ENF-IF GOTO Main
Bookmarks