Working with Shift Register

Working with Shift Register © GPL3+

This project demonstrates the working with Shift Register.

  • 3,234 views
  • 2 comments
  • 8 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 in progress by LAGSILVA

  • 25,152 views
  • 22 comments
  • 60 respects

4 Wire LCD Control with BL and Contrast Using Shift Register

Project showcase by Mike Kowalski

  • 2,447 views
  • 0 comments
  • 11 respects

Switching Using Transistor

by SBR

  • 4,654 views
  • 12 comments
  • 30 respects

Arduino Burglar

Project showcase by paolo_cravero

  • 3,045 views
  • 2 comments
  • 7 respects

Arduino Bluetooth Robot for Android Device

Project showcase by aip06

  • 3,094 views
  • 2 comments
  • 15 respects
Add projectSign up / Login