Able Varghese
Published © GPL3+

Expanding I/O pins using shift register

A simple project which will help you to understand shift registers.

BeginnerProtip30 minutes2,306
Expanding I/O pins using shift register

Things used in this project

Hardware components

UTSOURCE Electronic Parts
UTSOURCE Electronic Parts
×1
UTSOURCE 754HC595N
×1
ARDUINO UNO
×1
UTSOURCE LED
×12
Resistor 220 ohm
Resistor 220 ohm
×8
UTSOURCE jumper wire
×10

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Arduino code for shiftregister

Arduino
int CLOCK = 10;
int LATCH = 9;
int DATA  = 8;

void setup() 
{
  pinMode(CLOCK, OUTPUT);
  pinMode(LATCH, OUTPUT);
  pinMode(DATA, OUTPUT);
}


void clocke(){
digitalWrite(CLOCK,HIGH);
digitalWrite(CLOCK,LOW);
}
void latch(){
digitalWrite(LATCH,HIGH);
digitalWrite(LATCH,LOW);
  
}

void loop() 
{
int i,j,k;
for(i=0;i<8;i++){
  digitalWrite(DATA,LOW);
  clocke();
}
latch();
for(i=0;i<8;i++){
j=HIGH;
digitalWrite(DATA,j);
clocke();
latch();
delay(500);
j=~j;
}
for(i=0;i<8;i++){
j=LOW;
digitalWrite(DATA,j);
clocke();
latch();
delay(500);
j=~j;
}

Credits

Able Varghese
3 projects • 12 followers
i am pursuing bachelor’s degree in Electronics Engineering .Happy with making irrespective of it’s nature,from coding to Welding
Contact

Comments

Please log in or sign up to comment.