Advertisement
jmyean

Setting Up a Shift Register Circuit with LEDs

Apr 30th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * Jung Min Yean
  3.  * Learning How to Use a Shift Register
  4.  * 04/29/2019
  5.  */
  6.  
  7.  const int Data = 8; // The output
  8.  const int Latch = 9;
  9.  const int Clock = 10; // Goes around the Shift Register
  10.  
  11. void setup()
  12. {
  13.   pinMode(Data, OUTPUT);
  14.   pinMode(Latch, OUTPUT);
  15.   pinMode(Clock, OUTPUT);
  16.  
  17.    digitalWrite(Latch, LOW);
  18.   shiftOut(Data, Clock, MSBFIRST, B11111111); // B means Binary - 1 is on and 0 is off
  19.   digitalWrite(Latch, HIGH);
  20.   delay(200);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement