(I use 3 shift registers and 8 RGB Leds.)
Just a piece of code for using three 74HC595 shift registers to count from 0 to 255 which can control them to change colours.
colour changing
The shift register gives 8 outputs which each of them driving a LED, thus controlling a total of 8 LEDs. But the good thing is that it needs 3 inputs only; namely data input, clock, and latch. This means that we manage to drive 8 LEDs with 3 output pins from Arduino board.
74HC595 shift register
The 74HC595 shift register pin layout
Reference
没有评论:
发表评论