|This page is intended as a reference for core developers only, and the content is only changed after a consensus has been reached through discussion of any such changes. Please use the Discussion page to talk about any changes or issues you have with the current implementation.|
|Classification||Bit shifting methods|
|Version introduced||1.0 (0100)|
uint16_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t count, uint8_t delayTime)
The shiftIn() method reads data one bit at a time.
Black Box Input
Black Box Output
int. The data read from the pin is returned.
None. Single signature only.
shiftIn() can start from the most or the least significant bit (starts from leftmost or rightmost bit). This method is very useful to manage shift registers (like CD4021), which are devices that convert data from parallel to serial using one Wiring pin for receiving data, one for the clock, and one for the strobe (latch).
MSBFIRST stands for most significant bit first (leftmost bit), LSBFIRST stands for less significant bit first (rightmost bit).
For Wiring 1.1
According to Issue 9, pinRead() will be defined as:
uint16_t shiftIn(pin_t dataPin, pin_t clockPin, uint8_t bitOrder, uint8_t count, uint8_t delayTime)
See Issue 9 for more details.