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