Both these lines...
If (BUTTONS & %00001000) = 1 THEN Menu_1 = 1
If (BUTTONS & %00001000) = 0 THEN Menu_1 = 0
Can be simply replaced with...
Menu_1=BUTTONS.3
Which means go take Bit 3 of variable BUTTONS and put it into Bit variable Menu_1
Oh... and Yes, bit manipulation like this IS described in the PBP manual...
You can also do things like...
Menu_1=PORTB.3
Which means go read PortB.3 and put that into Bit variable Menu_1
And you can also go a stage further...
MenuButton var PortB.3 ' Declare this at the start of your program...
...thereafter anytime you want you can simply ask...
IF MenuButton=0 then Goto MenuEntry
Which is the same as asking...
If PortB.3=0 then Goto MenuEntry
and so on, and so on, ad nauseum...
Bookmarks