> For the complete documentation index, see [llms.txt](https://learn.breadstick.ca/breadstick/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.breadstick.ca/breadstick/breadsticks/raspberry-breadstick/code-examples/rgb-blink.md).

# RGB Blink

## Code

```python
"""
Raspberry Breadstick RGB Blink
Breadstick Innovations
March 26, 2024

This code uses the DotStar library to blink 3 of the SK9822 RGB LEDs
"""

from board import *
from time import sleep
from adafruit_dotstar import DotStar

leds = DotStar(DOTSTAR_CLOCK, DOTSTAR_DATA, 24, brightness=0.02, auto_write=False)

RED = (255,0,0)
GREEN = (0,255,0)
BLUE = (0,0,255)
OFF = (0,0,0)

leds.fill(OFF)
leds.show()

while True:
    leds[0] = RED
    leds.show()
    sleep(0.1)
    
    
    leds[0] = OFF
    leds.show()
    sleep(0.1)
    
    leds[12] = GREEN
    leds.show()
    sleep(0.1)
    
    
    leds[12] = OFF
    leds.show()
    sleep(0.1)
    
    leds[23] = BLUE
    leds.show()
    sleep(0.1)
    
    
    leds[23] = OFF
    leds.show()
    sleep(0.1)
    
    
```
