Hello. Sorry if this noob question has been asked and answered before. I'm sure it has but I don't know what search terms to use to try to find the answer here so I'm asking it, and I'm sure to many its VERY basic.
So I have and Arduino Uno driving five tpic6b595's daisychained to light up to 40 leds( for now, operate solenoids later) and I've made good progress building it and being able to turn on any given led, such as led#31 by using shiftOut statements in my sketch like this;
But there must be a better way right? I would like to be able to just do something like
(digitalWrite 31, HIGH) and it should know to turn on the second led on the fourth register without me having to manually pump all this stuff through the other registers to get there?
Thanks for any insight.
JC
Thanks much for the quick replies! I guess I feel like I'm taking a giant step backwards from when I was multiplexing tlc5940's several weeks ago. So with the tlc5940's you just go in to the library config file and edit it to tell it how many chips are daisychained, then in the program you tell it to light pin#31 or whatever and it just knows. Am I just whining? lol... or could we say that the tpic6b595 (or other 595's) have less sophisticated Arduino programming support for some reason? Although I'm also guessing that it is me who needs a more sophisticated understanding of all this!
jcmusix:
So with the tlc5940's you just go in to the library config file and edit it to tell it how many chips are daisychained, then in the program you tell it to light pin#31 or whatever and it just knows.
Feel free to add "const unsigned NumberOfRegisters = 5;" and use 'NumberOfRegisters' instead of the constant '5' in the above code.