From e0e723e95bac58db8fba923630fbf432bc34e52c Mon Sep 17 00:00:00 2001 From: Ben Nuttall Date: Mon, 17 Oct 2016 23:02:18 +0100 Subject: [PATCH] Add code example for Blinkt! --- src/en/overlay/blinkt.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/en/overlay/blinkt.md b/src/en/overlay/blinkt.md index 091e613..ed826c6 100644 --- a/src/en/overlay/blinkt.md +++ b/src/en/overlay/blinkt.md @@ -26,6 +26,23 @@ pin: mode: output active: high --> -#Blinkt! +# Blinkt! -Blinkt! is a super slimline Raspberry Pi Add-on board with 8 APA-102 LEDs. \ No newline at end of file +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) +```