Life's caught up with me lately, but don't worry, I'm working on something new for all of you guys :). Keep checking back!
Links to this post
A blog about Arduino, and my antics to master it!
#define sLatch 2
#define sClock 3
#define sData 4
#define commandData B00010001 // command = write to pot 0
byte data;
void setup()
{
pinMode(sLatch, OUTPUT);
pinMode(sClock, OUTPUT);
pinMode(sData, OUTPUT);
}
void loop()
{
for (int i = 0; i<256; i++) { digitalWrite(sLatch, LOW); shiftOut(sData, sClock, MSBFIRST, commandData); shiftOut(sData, sClock, MSBFIRST, i); digitalWrite(sLatch, HIGH); delay(5); } for (int i = 255; i>-1; i--) {
digitalWrite(sLatch, LOW);
shiftOut(sData, sClock, MSBFIRST, commandData);
shiftOut(sData, sClock, MSBFIRST, i);
digitalWrite(sLatch, HIGH);
delay(5);
}
}
