Quote Originally Posted by ecoli-557 View Post
Thanks Guys!
While all are better than what I was playing with, I like the array scheme. I just don't do enough arrays to keep them front and center in my head.
Unfortunately, I didn't have the presence of mind to neatly stack the inputs into a nibble on a port..... using A0, A1, A4, and A5 on a 16F616
There are ways around this.

One is to use maths

myvar=PORTA.0+PORTA.1*2+PORTA.4*4+PORTA.5*8

Another way is bit manipulation

myvar=PORTA & %00110011 ' select the input pins
myvar=(myvar & %00000011) + (myvar & %00110000)>>2 'selects A0,A1 then selects A4 and A5 moves then to A2 and A3 and adds to A0,A1

Another way is to set Aliases for the pins which relate to myvar. I will let you look into that one and I am sure there must be other workarounds.

Then myvar can be used in LOOKUP to set an output pattern or used in SELECT CASE or IF THEN, the choice is yours.