@@ -36,16 +36,10 @@ This is easily achieved by downloading
36
36
or individual libraries can be installed using
37
37
`circup <https://github.com/adafruit/circup >`_.
38
38
39
- .. todo :: Describe the Adafruit product this library works with. For PCBs, you can also add the
40
- image from the assets folder in the PCB's GitHub repo.
39
+ * `NeoPixel Products <https://www.adafruit.com/category/168 >`_
41
40
42
- `Purchase one from the Adafruit shop <http://www.adafruit.com/products/ >`_
43
41
Installing from PyPI
44
42
=====================
45
- .. note :: This library is not available on PyPI yet. Install documentation is included
46
- as a standard element. Stay tuned for PyPI availability!
47
-
48
- .. todo :: Remove the above note if PyPI version is/will be available at time of release.
49
43
50
44
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
51
45
PyPI <https://pypi.org/project/adafruit-circuitpython-pixelmap/> `_.
@@ -85,7 +79,7 @@ following command to install:
85
79
86
80
.. code-block :: shell
87
81
88
- circup install pixelmap
82
+ circup install adafruit_pixelmap
89
83
90
84
Or the following command to update an existing version:
91
85
@@ -96,8 +90,37 @@ Or the following command to update an existing version:
96
90
Usage Example
97
91
=============
98
92
99
- .. todo :: Add a quick, simple example. It and other examples should live in the
100
- examples folder and be included in docs/examples.rst.
93
+ .. code-block :: python
94
+
95
+ import board
96
+ import neopixel
97
+ import time
98
+ from adafruit_pixelmap import PixelMap, horizontal_strip_gridmap, vertical_strip_gridmap
99
+
100
+ # Update to match the pin connected to your NeoPixels
101
+ pixel_pin = board.NEOPIXEL
102
+
103
+ # Update to match the number of NeoPixels you have connected
104
+ pixel_num = 32
105
+
106
+ pixels = neopixel.NeoPixel(pixel_pin, pixel_num, brightness = 0.1 , auto_write = True )
107
+
108
+ pixel_wing_vertical = PixelMap.vertical_lines(
109
+ pixels, 8 , 4 , horizontal_strip_gridmap(8 , alternating = False )
110
+ )
111
+ pixel_wing_horizontal = PixelMap.horizontal_lines(
112
+ pixels, 8 , 4 , horizontal_strip_gridmap(8 , alternating = False )
113
+ )
114
+
115
+ for row in range (len (pixel_wing_horizontal)):
116
+ pixels.fill(0x 00000 )
117
+ pixel_wing_horizontal[row] = 0x 00ff00
118
+ time.sleep(0.3 )
119
+
120
+ for row in range (len (pixel_wing_vertical)):
121
+ pixels.fill(0x 00000 )
122
+ pixel_wing_vertical[row] = 0x ff00ff
123
+ time.sleep(0.3 )
101
124
102
125
Documentation
103
126
=============
0 commit comments