uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder)
shiftIn() utilises a pair of I/O pins to create a half-duplex synchronous serial interface. clockPin is toggled repeatedly and each time it goes HIGH the dataPin is sampled as one bit of a byte. That bit is added to the output value which is shifted either left or right to accommodate it. The parameter bitOrder indicates in which direction the shift should occur and to which end of the byte the incoming bit should be added. Possible values for bitOrder are MSBFIRST or LSBFIRST.
Eight bits are received in this manner before the function returns the value that has been received.
This functionality works akin to the receiving portion of a master SPI interface.
The received byte.
shiftIn() conforms to the Arduino 1.6.x API.
uint8_t val = shiftIn(3, 4, MSBFIRST);
digitalRead(), digitalWrite(), getPinMode(), pinMode(), pulseIn(), shiftOut()