Commit 8948fcf9 authored by schneider's avatar schneider
Browse files

more sewable led content

parent cccdd39b
Pipeline #4395 passed with stage
in 15 seconds
......@@ -105,4 +105,20 @@ while True:
```
An example which connects the accelerometer with multiple RGB LEDs. They start lighting up when the card10 is moved:
```
import bhi160
import gpio
import ws2812
LED_NUM = 1
LED_PIN = gpio.WRISTBAND_1
acc = bhi160.BHI160Accelerometer(sample_rate=30)
while True:
data = acc.read()
if len(data) > 0:
color = (abs(int(data[0].x * 64)), abs(int(data[0].y * 64)), abs(int(data[0].z * 64)))
#print(data[0], color)
ws2812.set_all(LED_PIN, [color] * LED_NUM)
```
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment