How to Make a 74HC595 Shift Resistor Circuit
by coolyyz in Circuits > Arduino
13457 Views, 36 Favorites, 0 Comments
How to Make a 74HC595 Shift Resistor Circuit
What You Need
1 74hc595 shift resistor
8 leds
8 resistors (any will do i think)
Lost of jumpers
Breadboard
Arduino
And that's basically it
Shift Resistor
The Code
/*
This code lights up each LED connected to a 74HC595 as determined by the binary value of a counter. *
/ Pin connected to SRCLK of 74HC595 int CLOCK = 12; // Pin connected to RCLK of 74HC595 int LATCH = 11; // Pin connected to SER of 74HC595 int DATA = 10;
byte counter = 0;
void setup() { //set pins to output so you can control the shift register pinMode(LATCH, OUTPUT); pinMode(CLOCK, OUTPUT); pinMode(DATA, OUTPUT); }
void loop() { // take the latchPin low digitalWrite(LATCH, LOW); // shift out the bits: shiftOut(DATA, CLOCK, MSBFIRST, counter); //take the latch pin high so the LEDs update: digitalWrite(LATCH, HIGH); // pause before next value: delay(100);
counter = counter + 1;
}