This example from Waveshare Corporation realizes the flowing light effect of the RGB LED every second.