74HC595 Shift Register thingy majig.

74HC595 IC (Have)

I bought an expander mod (basically 74HC595 with a PCB) and wired it all up, now using

int dataPin = 2;
int latchPin = 3;
int clockPin = 4;

void setup() {
  pinMode(dataPin, OUTPUT);
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
}

void loop() {
  for (int currentValue = 0; currentValue < 256; currentValue++) {
    // Disable the latch while we clock in data
    digitalWrite(latchPin, LOW);
    
    // Send the value as a binary sequence to the module
    shiftOut(dataPin, clockPin, MSBFIRST, currentValue);

    // Enable the latch again to set the output states
    digitalWrite(latchPin, HIGH);

    delay(80);
  }
}

I guess, soldering and wiring it up was the easy part...

I bought 2 of them to control up to 16 LED's, but i decided to stick to 8 and have some fun before I try some kind of LED light show.. so ok then
this example is a fun way to watch the binary values (0 - 255) (00 - FF) (0 0 0 0 0 0 0 0 - 1 1 1 1 1 1 1 1) I understand how binary works, i understand
what's going on.

Anyone done anything "fun" with on of these shift registers? - my goal is to do some kind of pretty LED display, but right now this binary counter has me
hooked, it's like watching TV...

Anyone tried hooking into some kind of digital stream and then watch the LED's sequence depending on the data? either that or go buy a 2nd 7 LED segment
and have some kind of counter, or maybe a night rider with the led's in a pattern..

Anyway, Binary Manipulation Functions..

Any pointers? webpages? I quickly googled found little of use....

Here's my green Binary Counter in action

Cheers, Nick :slight_smile:

P.S wow looks like you were busy at some point with these IC's :slight_smile: well done :slight_smile:

Ever thought about having a binary counter christmas tree? some kind of Analogue to Digital converter (eg, mp3 player, christmas music) (A0) then based on the value, spit out the value
into binary which gets turned into an LED pattern on your tree?...

Well I did buy these with the intention of some kind of christmas show... lol

I haven't had that specific thought, but you could do all sorts of things along those lines. :slight_smile:

Musical show: http://coolarduino.wordpress.com/2012/06/21/tears-of-rainbow/

Another neat thread about Shift Register's.

http://arduino.cc/forum/index.php/topic,66988.0.html

More Info:

http://bildr.org/2011/02/74hc595/