Professional Documents
Culture Documents
01ARDUIN
7-8
ARDUIN
ICArduino
(IC)
IC
IC/
0/1
IC
ICDIP
7-8
74HC595
Arduino
74HC595
74HC5958shift register
8
8
8
7-10
LSBFIRST(
)
MSBFIRST(
)a-g
7-13
74HC595
QB-QH
VCC5V
SER data
pin 2
OE
RCLK
latch pin 3
SRCLK
clock pin 4
SRCLR
74HC595
LED
7-3
shiftOut()
ArduinoshiftOut()()
874HC595
74HC595
byte index=0;
const byte
LED[10]={B01111110,B00110000,B01101101,B01111001,
B00110011,B01011011,B01011111,B01110000,B01111111,B0
1111011};
void setup() {
pinMode(3,OUTPUT); pinMode(4,OUTPUT);
pinMode(2,OUTPUT); // 3 latch, 4clock, 2data
}
void loop() {
digitalWrite(3,LOW); //
shiftOut(2,4,LSBFIRST,LED[index]);
digitalWrite(3,HIGH); //
delay(1000); index++; if (index == 10) index=0; }
LSBFIRST()MSBFIRST(
)a~g
7-14