Created
October 31, 2015 17:10
-
-
Save Valindo/b5f07b20526d49ed7c6a 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 latchPin = 10; | |
int clockPin = 9; | |
int dataSerial = 8; | |
boolean currentValue[8] = {false, false, false, false, false, false, false, false}; | |
int i; | |
void setup() { | |
// put your setup code here, to run once: | |
pinMode(latchPin, OUTPUT); | |
pinMode(clockPin, OUTPUT); | |
pinMode(dataSerial, OUTPUT); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
int i = 1; | |
i--; | |
currentValue[i] = !currentValue[i]; | |
digitalWrite(latchPin, LOW); | |
for ( i = 0; i < 8 ; i++ ) | |
{ | |
digitalWrite(clockPin, LOW); | |
digitalWrite(dataSerial, currentValue[i] ? HIGH:LOW); | |
digitalWrite(clockPin, HIGH); | |
} | |
digitalWrite(latchPin, HIGH); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment