PDA

View Full Version : Using SHIFTIN



TonyA
- 31st May 2006, 15:38
Hi,

I'm just learning about shiftin. I'm using the pic18f452. Would it be possible to shiftin 12 bits and assign each bit a separate variable?

shiftin datapin, clockpin, mode, [var1\1, var2\1, var3\1, ... var12\1]

I am using a shift register that will send out the state of 12 switches to the pic. I need to read the state of each individual switch. var1 is the variable for the state of the 1st switch, etc. I am putting one bit in each variable.

Do I have this right?

Thanks for any help.
TonyA