/* * CylonEyes * --------- * Implement a Cylon-like eye scanning display using two 74HC595s, 16 LEDs * Optionally, to get a more incadescent-like "fade" of light, insert a * low-pass filter with a transistor and big capacitor between 595s and LEDs. * * Much of this code stolen from: http://www.arduino.cc/en/Tutorial/ShiftOut * * Created 27 November 2006 * copyleft 2006 Tod E. Kurt * http://hackingroomba.com/ */ int dataPin = 7; // Pin connected to DS of 74HC595 int clockPin = 6; // Pin connected to SH_CP of 74HC595 int latchPin = 5; // Pin connected to ST_CP of 74HC595 int t2 = 30; int t1 = 80; int t0 = 250; void setup() { //set pins to output because they are addressed in the main loop pinMode(latchPin, OUTPUT); //function that blinks all the LEDs //gets passed the number of blinks and the pause time blinkAll16(1,1000); } void loop() { //blinkAll16(2,1000); for(int i=0; i<4; i++) { delay(t0); //delay(t1); //blinkAll16(1,delayt2); //charge capacitors for (int j = 0; j < 15; j++) { digitalWrite(latchPin, 0); shiftOut16(dataPin, clockPin, 1<<(j+1) | 1<=0; j--) { digitalWrite(latchPin, 0); shiftOut16(dataPin, clockPin, 1<<(j-1) | 1<=0; i--) { digitalWrite(myClockPin, 0); int pinState = (myDataOut & (1<