Working with Shift Register

Working with Shift Register © GPL3+

This project demonstrates the working with Shift Register.

  • 9,636 views
  • 4 comments
  • 10 respects

Components and supplies

Apps and online services

About this project

This project demonstartes the working with Shift Register.

Objective:

  • Blink all the LEDs together.
  • Switching ON one by one and then switching OFF one by one.
Working with Shift Register

Code

All LEDs blinking togetherArduino
Code to make all LEDs blink together.
const int DataPin = 2;
const int ClockPin = 3;
const int LatchPin = 4;

void setup()
{
	pinMode (DataPin, OUTPUT);
	pinMode (ClockPin, OUTPUT);
	pinMode (LatchPin, OUTPUT);
}

void loop()
{
digitalWrite (LatchPin, LOW);
shiftOut (DataPin, ClockPin, LSBFIRST, 255);
digitalWrite (LatchPin, HIGH);
delay (1000);
digitalWrite (LatchPin, LOW);
shiftOut (DataPin, ClockPin, LSBFIRST, 0);
digitalWrite (LatchPin, HIGH);
delay (1000);
}
LEDs ON one by one and OFF one by oneArduino
LEDs will be ON one by one and will be OFF one by one
const int DataPin = 2;
const int ClockPin = 3;
const int LatchPin = 4;

byte Data = 0;

void setup()
{
  pinMode (DataPin, OUTPUT);
  pinMode (ClockPin, OUTPUT);
  pinMode (LatchPin, OUTPUT);
}

void loop()
{
  shiftWrite (0,1);
  delay(1000);
  shiftWrite (1,1);
  delay(1000);
  shiftWrite (2,1);
  delay(1000);
  shiftWrite (3,1);
  delay(1000);
  shiftWrite (4,1);
  delay(1000);
  shiftWrite (5,1);
  delay(1000);
  shiftWrite (6,1);
  delay(1000);
  shiftWrite (7,1);
  delay(1000);
  shiftWrite (0,0);
  delay(1000);
  shiftWrite (1,0);
  delay(1000);
  shiftWrite (2,0);
  delay(1000);
  shiftWrite (3,0);
  delay(1000);
  shiftWrite (4,0);
  delay(1000);
  shiftWrite (5,0);
  delay(1000);
  shiftWrite (6,0);
  delay(1000);
  shiftWrite (7,0);
  delay(1000);
}

void shiftWrite(int Pin, boolean State)
{
  bitWrite (Data, Pin, State);
  digitalWrite (LatchPin, LOW);
  shiftOut (DataPin, ClockPin, MSBFIRST, Data);
  digitalWrite (LatchPin, HIGH);
}

Schematics

Breadboard Diagram
Make connections as shown in the breadboard diagram
Working with shift register 684qdj4r8e

Comments

Similar projects you might like

Digital Clock with Arduino, RTC and Shift Register 74HC595

Project showcase by LAGSILVA

  • 52,931 views
  • 37 comments
  • 100 respects

Switching Using Transistor

by SUMAN BARGAV R

  • 46,994 views
  • 22 comments
  • 61 respects

Arduino Burglar

Project showcase by paolo_cravero

  • 6,727 views
  • 2 comments
  • 9 respects

4 Wire LCD Control with BL and Contrast Using Shift Register

Project showcase by Mike Kowalski

  • 4,936 views
  • 3 comments
  • 12 respects

Arduino 74hc595 Shift Register With 18 eflects

Project tutorial by Mr.ElectroUino

  • 3,417 views
  • 2 comments
  • 12 respects
Add projectSign up / Login