This is an example of the ShiftRegisterOut class of the Control Surface library. It creates light effects using three 8-bit shift registers and some RGB LEDs.
Boards:
AVR, AVR USB, Nano Every, Nano 33 IoT, Nano 33 BLE, UNO R4, Pi Pico, Due, Teensy 3.x, ESP8266, ESP32
Connections
Connect three daisy-chained shift registers to the SPI pins.
Connect 8 RGB LEDs (+ current limiting resistors) to the outputs of the shift registers.
If you wired the LEDs as RGB (red first, then green and then blue), the red bit is 0, the green bit is 1 and the blue bit is 2.
If you wired the LEDs as BGR (blue first, then green and then red), the red bit is 2, the green bit is 1 and the blue bit is 0.
Other combinations are possible as well.
Behavior
This example will turn on all red LEDs one by one, then turn them off one by one, next, it will turn on and off all green LEDs in the same manner, and finally the same for the blue LEDs. This is repeated indefinitely.