-
-
Save JeffersGlass/20596cf3ab00792508f9e556d1aad62b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int CLOCK_PIN = 10; | |
int DATA_PIN = 11; | |
int LATCH_PIN = 12; | |
void setup() { | |
pinMode(CLOCK_PIN, OUTPUT); | |
pinMode(DATA_PIN, OUTPUT); | |
pinMode(LATCH_PIN, OUTPUT); | |
} | |
void loop() { | |
//shiftOut(dataPin, clockPin, bitOrder, value) | |
digitalWrite(LATCH_PIN, LOW); //set the latch to low so we can raise it later | |
digitalWrite(CLOCK_PIN, LOW); //make sure clock pin is low before we start | |
shiftOut(DATA_PIN, CLOCK_PIN, LSBFIRST, B11110000); //Shift out the data | |
digitalWrite(LATCH_PIN, HIGH); //Latch the data in | |
delay(1000); | |
digitalWrite(LATCH_PIN, LOW); //set the latch to low so we can raise it later | |
digitalWrite(CLOCK_PIN, LOW); //make sure clock pin is low before we start | |
shiftOut(DATA_PIN, CLOCK_PIN, LSBFIRST, B00001111); //Shift out the data | |
digitalWrite(LATCH_PIN, HIGH); //Latch the data in | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment