ShiftOut/developers

From Wiring

Jump to: navigation, search
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.
shiftOut()
Classification Bit shifting methods
Suggested location WShift.h
C++ required No
Timing constraints None
Version introduced 1.0 (0100)
Framework dependencies None
Prototype(s)
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint16_t val, uint8_t count, uint8_t delayTime)
Required? Yes
Issues None


Contents

Description

The shiftOut() method writes data to a pin one bit at a time.

Black Box Input

The pin send to receive data, the pin used as clock, the bit order (from MSBFIRST or LSBFIRST), the data to send out (in byte or unsigned int), the number of bits to send and the delay time are provided.

Black Box Output

Nothing is returned.

Overloading

None. Single signature only.

Notes

shiftOut() 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 (output), which are devices that convert data from serial to parallel using one Wiring pin for sending 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).

Proposed Changes

For Wiring 1.1

According to Issue 9, pinRead() will be defined as:

void shiftOut(pin_t dataPin, pin_t clockPin, uint8_t bitOrder, uint16_t val, uint8_t count, uint8_t delayTime)

See Issue 9 for more details.

Personal tools