This will (hopefully) be the easy part, and I wouldn't be surprised if I finished up today (*knock on wood*).
Thanks!
-Stephen
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);
}
}