rgb_strip
¶
RGB Strip utilities.
Classes:
| Name | Description |
|---|---|
RgbStrip |
Wrapper for neopixel strip. |
Functions:
| Name | Description |
|---|---|
set_intensity |
Set the intensity of a color. |
test_rgb_strip |
Test for the rgb strip class. |
RgbStrip
¶
Wrapper for neopixel strip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pin
|
int
|
The pin the neopixel strip is connected to. |
required |
n
|
int
|
Amount of pixels in the strip. Defaults to |
LED_COUNT
|
Methods:
| Name | Description |
|---|---|
reset |
Reset the strip and turns all leds off. |
set_rgb_led |
Set one led of the rgb strip. |
set_rgb_strip |
Set all leds of the rgb strip at once. |
Source code in src/aalec/rgb_strip.py
43 44 45 46 47 | |
reset
¶
reset() -> None
Reset the strip and turns all leds off.
Source code in src/aalec/rgb_strip.py
84 85 86 87 | |
set_rgb_led
¶
Set one led of the rgb strip.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
led
|
int
|
Index of the led in the strip (starts with 0). |
required |
color
|
RgbColor
|
The color to set |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If the |
Source code in src/aalec/rgb_strip.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
set_rgb_strip
¶
Set all leds of the rgb strip at once.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
colors
|
list[RgbColor]
|
A list of colors. |
required |
Raises:
| Type | Description |
|---|---|
AttributeError
|
If the length of the list of colors is not exactly the number of leds in the strip. |
Source code in src/aalec/rgb_strip.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
set_intensity
¶
Set the intensity of a color.
Set the sum of the r,g and b values to intensity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color
|
RgbColor
|
Color to balance |
required |
intensity
|
int
|
Overall intensity of the color (0 - 786). Defaults to MEDIUM. |
MEDIUM
|
Returns:
| Name | Type | Description |
|---|---|---|
RgbColor |
RgbColor
|
Balanced color. |
Source code in src/aalec/rgb_strip.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
test_rgb_strip
¶
test_rgb_strip()
Test for the rgb strip class.
Source code in src/aalec/rgb_strip.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |