Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:2564292
Created May 1, 2012

What would you like to do?
const int latchPin = 8;
const int clockPin = 12;
const int dataPin = 11;
char inputString[2];
int arreglo[] = {2,4,6,8,10,12,14};
unsigned int bitsToSend = 0;
void setup() {
pinMode(latchPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
void loop() {
for(int pos = 0; pos<7; pos++){
void registerWrite(int pos) {
digitalWrite(latchPin, LOW);
bitWrite(bitsToSend, pos, HIGH);
byte registerOne = highByte(bitsToSend);
byte registerTwo = lowByte(bitsToSend);
shiftOut(dataPin, clockPin, MSBFIRST, registerTwo);
shiftOut(dataPin, clockPin, MSBFIRST, registerOne);
digitalWrite(latchPin, HIGH);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment