Skip to content

Commit e232c18

Browse files
authored
Merge pull request #146 from Kasperror/patch-1
added setup instructions for sudo-less RPi usage
2 parents 9516aa9 + 51e4e3f commit e232c18

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,32 @@ need to be specified as it is computed from the supplied ``pixel_order``.
110110
pixel = neopixel.NeoPixel(board.D0, 1, pixel_order=neopixel.RGBW)
111111
pixel[0] = (30, 0, 20, 10)
112112
113+
Setup for sudo-less usage on Raspberry Pi boards
114+
================================================
115+
1. Enable both SPI and Serial port hardware (Serial interface). Do it by ``raspi-config`` tool or manually by adding
116+
117+
::
118+
119+
dtparam=spi=on
120+
enable_uart=1
121+
122+
to the ``/boot/config.txt``
123+
124+
2. Reboot the Pi to apply the changes - the hardware setup takes place during boot.
125+
3. Connect LED's DIN to ``GPIO10`` (physical pin 19)
126+
127+
When initializing the ``NeoPixel`` object **always** do it with ``board.D10`` (GPIO10)
128+
129+
.. code-block:: python
130+
131+
import board
132+
import neopixel
133+
134+
DATA_PIN = board.D10
135+
pixel = neopixel.NeoPixel(DATA_PIN, ...)
136+
137+
Now you can execute the code using ``python`` without ``sudo``
138+
113139
Documentation
114140
=============
115141

0 commit comments

Comments
 (0)