My current idea is to have a small round coffee table with a glass top that hides leds underneath. Then use 2 shift registers to control the leds in patterns.
I'm not very familiar with shift registers, can I hook up 2 and then have the arduino turn on one led controlled from one shift register and then turn on another from the other shift register? Or is it all pre-set and the patterns have to be coordinated on each shift register?
Not sure if that made sense, but I'm wondering if its as nearly as simple as having all the leds have variable names and then saying turn on this led and then this one.
Take a look at the ShiftOut tutorial on the Arduino website, will give you a starting point. And take a look at the bottom of the page for a few more tutorials on using em!
Hope this helps, I’m waiting for some shiftregisters myself and hope to get some running shortly!
After reading some of that article it seems like I can control the leds individually on any of the shift registers. Is that correct?
Also for the shiftOut() command what is the difference between MSBFIRST and LSBFIRST, does it matter if its most significant or least significant going first?
In case of LEDs it just affects the order of lighting up. Just try it and see what happens ;-)
So with MSBFIRST it will light up in one direction and with LSBFIRST it will light up in the other direction?
Sorry, wish I could help answer more questions. I've only gotten as far as reading the Tutorial! Give it about a week and I should be able to answer a little more :D
You can also do a video search on Arduino 74HC595 and you'll get some hits for some stuff somewhat-similiar to what you're trying to accomplish.
it seems like I can control the leds individually on any of the shift registers.
Yes. What you’ll need to do is create a byte that has the state of all 8 LEDs connected to that shift register, and shift that byte out. In other words, you can’t just write a call to the library that says “Turn on (or off) LED #4”, but you could write your own routine to keep track of what the other LEDs are supposed to be, and combine them when you make a call like that.
Alright that sounds great. I want to create 4 different patterns and have the leds light up in those patterns depending on which button is pressed.
Ran: Do you mean just store the Byte, then BitWise XOR the bit in question regardless of the other bits ?? or am I missing something (likely) ?
(I’ll shortly need to do something similiar - say set bit 4 to 1/0 whilst retaining the others… http://www.arduino.cc/playground/Code/BitMath… Im just going off that page…)