yea, that was too many characters, so I had to post it in a second post.
I want the Arduino (ATmega168) to mimic that code. But that's really hard with this shift register. Basically, I need it to check the IR detector input every time it lights up an LED. How do I do that? And it's really finicky with this IR detector, too. You have to put the "pinMode(irPin, INPUT)" before every reading is taken, or it does not work. AND you have to pause about 100ms after declaring the pin as an input before taking a reading. That's going to slow this down too much!
So there's a few problems I need to solve:
- The finicky IR detector readings
- How to take readings from the IR detector at each lighting of an LED
- (also; I'm adding this) Get the middle RGB LED to light up right after the ones next to it to complete the pattern (remember, this LED is controlled directly by the ATmega168, not the shift register.
- (I'm adding this too) How to light up just one LED with the shift register??
Thanks for the support.