SHARE
TWEET

Setting Up a Shift Register Circuit with LEDs

jmyean Apr 30th, 2019 94 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);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top