Add code example for Blinkt!
This commit is contained in:
parent
692c174572
commit
e0e723e95b
@ -29,3 +29,20 @@ pin:
|
|||||||
# Blinkt!
|
# Blinkt!
|
||||||
|
|
||||||
Blinkt! is a super slimline Raspberry Pi Add-on board with 8 APA-102 LEDs.
|
Blinkt! is a super slimline Raspberry Pi Add-on board with 8 APA-102 LEDs.
|
||||||
|
|
||||||
|
## Code
|
||||||
|
|
||||||
|
```python
|
||||||
|
from blinkt import set_pixel, show
|
||||||
|
from random import randint
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
|
while True:
|
||||||
|
for pixel in range(8):
|
||||||
|
r = randint(255)
|
||||||
|
g = randint(255)
|
||||||
|
b = randint(255)
|
||||||
|
set_pixel(pixel, r, g, b)
|
||||||
|
show()
|
||||||
|
sleep(0.1)
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user