Skip to content
Snippets Groups Projects
Commit 8948fcf9 authored by schneider's avatar schneider
Browse files

more sewable led content

parent cccdd39b
No related branches found
No related tags found
No related merge requests found
Pipeline #4395 passed
......@@ -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)
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment