Hi all,
Decimal or Hex ? It's depend of BRANCH syntax. Can I write something like
BRANCH PORTB [dog, cat,fish] ???
For nibbles, I can choose between
initial:
TRISB = 111111
SWVAR VAR BYTE
SWVAR1 VAR BYTE
SWVAR2 VAR BYTE
code1:
SWVAR = PORTB
SWVAR1 = SWVAR & $0F
SWVAR2 = SWVAR & $F0
or code2:
SWVAR1 = SWVAR >> 4 'Right shift myPortB 4 bits, (moves bits 7:4 to bits 3:0 and then set bits 7:4 to 0)
SWVAR2 = SWVAR & %00001111 'Mask off bits 7:4 to 0, Only get bits 3:0
switches will be active when pulling down... Do I change something in my code ?
Thanks for your time. Have a nice day. Oleg
Bookmarks