Devices & Components
Arduino Uno Rev3
74HC595
5 mm LED: Red
Hardware & Tools
10 Pc. Jumper Wire Kit, 5 cm Long
Software & Tools
Arduino IDE
Project description
Code
serial_to_paralell_shift
c_cpp
1int latchPin=11; 2int clockPin=9; 3int dataPin=12; 4int dt=250; 5 6byte LED1s=0b10101010; 7byte LED2s=0b01010101; 8 9void setup() { 10 // put your setup code here, to run once: 11Serial.begin(9600); 12pinMode(latchPin,OUTPUT); 13pinMode(dataPin,OUTPUT); 14pinMode(clockPin,OUTPUT); 15} 16 17void loop() { 18 // put your main code here, to run repeatedly: 19digitalWrite(latchPin,LOW); 20shiftOut(dataPin,clockPin,LSBFIRST,LED1s); 21digitalWrite(latchPin,HIGH); 22delay(dt); 23digitalWrite(latchPin,LOW); 24shiftOut(dataPin,clockPin,LSBFIRST,LED2s); 25digitalWrite(latchPin,HIGH); 26delay(dt); 27} 28
serial_to_paralell_shift
c_cpp
1int latchPin=11; 2int clockPin=9; 3int dataPin=12; 4int dt=250; 5 6 7byte LED1s=0b10101010; 8byte LED2s=0b01010101; 9 10void setup() { 11 12 // put your setup code here, to run once: 13Serial.begin(9600); 14pinMode(latchPin,OUTPUT); 15pinMode(dataPin,OUTPUT); 16pinMode(clockPin,OUTPUT); 17} 18 19 20void loop() { 21 // put your main code here, to run repeatedly: 22digitalWrite(latchPin,LOW); 23shiftOut(dataPin,clockPin,LSBFIRST,LED1s); 24digitalWrite(latchPin,HIGH); 25delay(dt); 26digitalWrite(latchPin,LOW); 27shiftOut(dataPin,clockPin,LSBFIRST,LED2s); 28digitalWrite(latchPin,HIGH); 29delay(dt); 30} 31
Downloadable files
74HC595 microchip
74HC595 microchip

Comments
Only logged in users can leave comments