Pages: [1]   Go Down
Author Topic: 74HC595 Shift Register thingy majig.  (Read 345 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 29
Posts: 2359
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

74HC595 IC (Have)

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

Code:
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

Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.gammon.com.au/forum/?id=11518
Logged

Offline Offline
Edison Member
*
Karma: 29
Posts: 2359
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cheers, Nick smiley
Logged

Offline Offline
Edison Member
*
Karma: 29
Posts: 2359
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Montreal
Offline Offline
Faraday Member
**
Karma: 27
Posts: 2566
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

USA, FL
Offline Offline
God Member
*****
Karma: 14
Posts: 688
A life? Where can I download one of those?
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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/
Logged

//LiNK

Pages: [1]   Go Up
Jump to: