Skip to content

Instantly share code, notes, and snippets.

@Valindo
Created October 31, 2015 17:10
Show Gist options
  • Save Valindo/b5f07b20526d49ed7c6a to your computer and use it in GitHub Desktop.
Save Valindo/b5f07b20526d49ed7c6a to your computer and use it in GitHub Desktop.
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