Which bit gets lost? the 1st bit or the last bit?
Context?
Only 8 bits will get shifted on, so the last one.
Do two shift to get 16 bits, combine together into an int and act on that.
Something like:
shiftIn (dataPin, clockPin, MSBFIRST, byte1); // xxxxxxxx
shiftIn (dataPin, clockPin, MSBFIRST, byte2); // y0000000 or y1111111 or yzzzzzzz with z unknown
newInt =( (byte1<<8) + byte2) >>7; // result should be 0b0000000xxxxxxxxy
// with x from byte1 and y from byte 2
The problem is that the 1st bit transmitted is a "0" dummy bit, then 8 bits. So it's the first bit that I have to lose.
Could like cycle the clock once then do a shiftIn()?
Do the two shiftIns still to receive:
0xxxxxxx yzzzzzzz
and manipulate accordingly to keep 7 x's and y. I think what I suggested will still work.