Go Down

Topic: 74HC595 help (Read 693 times) previous topic - next topic

martinbros

Jun 14, 2009, 02:12 am Last Edit: Jun 14, 2009, 02:14 am by martinbros Reason: 1
I have recently begun a project using two 74HC595's.

I have followed the shift out tutorial, but the software portion of the process is where i get a little lost.

What i would like to do is light up one of the sixteen leds at a time, kinda like a night rider effect.

I am new to the programming aspect of the arduino and would appreciate any help.

martinbros


zooto68

The ShiftOut Tutorial with 2 595's has them daisy chained together.

This means to get a knight Rider effect, you just need to turn one LED on at a time. 2 x 595's means you are going to shift out 2 x 8-bit numbers or 1x 16 bit number. Simply expand the for loop to run 16 times and in the loop the number you are going to send to ShiftOut will be a data type word (16 bits) that has the value of 1 bit shifted n amount of times

(1 << n)

Where n is a counter that you count from 0 to 15 and back again.


zooto68

#3
Jun 14, 2009, 04:08 am Last Edit: Jun 14, 2009, 04:08 am by zooto68 Reason: 1
p.s. don't bump a topic after only a few hours. Someone will no doubt answer eventually. It's not a 'while-u-wait' service ;)

Go Up