Index
 
  Reference for Wiring 1.0 (ALPHA) 0017+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.
Name  

shiftOut()

   
Examples  
int data = 0; // Wiring pin 0 for data 
int clock = 1;  // Wiring pin 1 for clock 
int strobe = 2;  // Wiring pin 2 for the strobe (latch) 
byte counter = 0; 
 
void setup() { 
  pinMode(data OUTPUT); 
  pinMode(clock, OUTPUT); 
  pinMode(strobe, OUTPUT); 
} 
 
void loop() { 
  digitalWrite(strobe, LOW); 
  shiftOut(data, clock, LSBFIRST, counter);  // writes counter to the register  
  digitalWrite(strobe, HIGH); 
  delay(1000); 
  counter = counter + 1; 
} 
 
 

Description   The shiftOut() method writes a byte of data one bit at a time. It can start from the most or the least significant bit of the byte (starts from leftmost or rightmost bit). This method is very useful to manage shift registers, which are devices that convert data from serial to parallel using one pin for receiving data, one for the clock, and one for the strobe (latch).

shiftOut() 메소드는 한번의 한개의 비트를 라이트 합니다. 바이트의 최하위 비트 또는 최상위 비트부터 라이트 시작합니다. 이 메소드는 쉬프트 레지스터를 유용하게 사용합니다. 쉬프트 레지스터는 시리얼 데이터를 파라렐로 변환하며 수신핀, 클록핀, 스트로브(래치)핀으로 구성됩니다. 

   
Syntax  
shiftOut(dataPin,clockPin,bitOrder,data)
   
Parameters  
dataPin   int: the pin used to send out the data

clockPin   int: the pin used as clock

bitOrder   MSBFIRST or LSBFIRST: the bit order to use. MSBFIRST stands for most significant bit first (leftmost bit), LSBFIRST stands for less significant bit first (rightmost bit).

MSBFIRST는 최상위 비트를 의미합니다. LSBFIRST는 최하위 비트를 의미합니다.
data   byte: the byte to send out.

   
Returns   none
   
Usage   Application
   
Related   MSBFIRST
LSBFIRST