From 9ada5a26df14b434be7e11d0f699f037c66c3a42 Mon Sep 17 00:00:00 2001 From: Kasperror <47153317+Kasperror@users.noreply.github.com> Date: Sun, 11 Dec 2022 01:56:41 +0100 Subject: [PATCH 1/5] added setup instructions for sudo-less RPi usage Resolved the problem when using the SPI MOSI (GPIO 10) would result in unexpected behaviour when sending signals for a long periods. Turns out that Serial interface/ Serial port hardware has to be enabled otherwise the communication on SPI was being cut after few seconds. --- README.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.rst b/README.rst index 41b05aa..400e8a0 100644 --- a/README.rst +++ b/README.rst @@ -110,6 +110,32 @@ need to be specified as it is computed from the supplied ``pixel_order``. pixel = neopixel.NeoPixel(board.D0, 1, pixel_order=neopixel.RGBW) pixel[0] = (30, 0, 20, 10) +Setup for sudo-less usage on Raspberry Pi boards +============= +1. Enable both SPI and Serial port hardware (Serial interface). Do it by ``raspi-config`` tool or manually by adding + + :: + + dtparam=spi=on + enable_uart=1 + + to the ``/boot/config.txt`` + +2. Reboot the Pi to apply the changes - the hardware setup takes place during boot. +3. Connect LED's DIN to ``GPIO10`` (physical pin 19) + +When initializing the ``NeoPixel`` object **always** do it with ``board.D10`` (GPIO10) + +.. code-block:: python + + import board + import neopixel + + DATA_PIN = board.D10 + pixel = neopixel.NeoPixel(DATA_PIN, ...) + +Now you can execute the code using ``python`` without ``sudo`` + Documentation ============= From 703a98f3af5eeadaf64dbd7a7c98de280debeddf Mon Sep 17 00:00:00 2001 From: Kasperror <47153317+Kasperror@users.noreply.github.com> Date: Mon, 12 Dec 2022 21:50:57 +0100 Subject: [PATCH 2/5] Apply suggestions from code review removed trailing whitespaces leading pylint to raise errors Co-authored-by: Scott Shawcroft --- README.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 400e8a0..40f683d 100644 --- a/README.rst +++ b/README.rst @@ -115,13 +115,12 @@ Setup for sudo-less usage on Raspberry Pi boards 1. Enable both SPI and Serial port hardware (Serial interface). Do it by ``raspi-config`` tool or manually by adding :: - dtparam=spi=on enable_uart=1 to the ``/boot/config.txt`` -2. Reboot the Pi to apply the changes - the hardware setup takes place during boot. +2. Reboot the Pi to apply the changes - the hardware setup takes place during boot. 3. Connect LED's DIN to ``GPIO10`` (physical pin 19) When initializing the ``NeoPixel`` object **always** do it with ``board.D10`` (GPIO10) From f4ebdde971ff37d543d0e214b68095f24c2a5bc0 Mon Sep 17 00:00:00 2001 From: Kasperror <47153317+Kasperror@users.noreply.github.com> Date: Mon, 12 Dec 2022 21:59:40 +0100 Subject: [PATCH 3/5] fixed boot/config.txt text changes display --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 40f683d..31097be 100644 --- a/README.rst +++ b/README.rst @@ -115,6 +115,7 @@ Setup for sudo-less usage on Raspberry Pi boards 1. Enable both SPI and Serial port hardware (Serial interface). Do it by ``raspi-config`` tool or manually by adding :: + dtparam=spi=on enable_uart=1 @@ -129,7 +130,7 @@ When initializing the ``NeoPixel`` object **always** do it with ``board.D10`` (G import board import neopixel - + DATA_PIN = board.D10 pixel = neopixel.NeoPixel(DATA_PIN, ...) From 261d1204df69873b307f63884c9e7aa2de3f3054 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 24 Feb 2023 16:52:52 -0600 Subject: [PATCH 4/5] make the formatter happy --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 31097be..7a1e57b 100644 --- a/README.rst +++ b/README.rst @@ -115,7 +115,7 @@ Setup for sudo-less usage on Raspberry Pi boards 1. Enable both SPI and Serial port hardware (Serial interface). Do it by ``raspi-config`` tool or manually by adding :: - + dtparam=spi=on enable_uart=1 From 26b47b141ba91492177ed593079d68298c3d1f27 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 24 Feb 2023 17:12:36 -0600 Subject: [PATCH 5/5] fix underline format in readme --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 7a1e57b..fce1a64 100644 --- a/README.rst +++ b/README.rst @@ -111,7 +111,7 @@ need to be specified as it is computed from the supplied ``pixel_order``. pixel[0] = (30, 0, 20, 10) Setup for sudo-less usage on Raspberry Pi boards -============= +================================================ 1. Enable both SPI and Serial port hardware (Serial interface). Do it by ``raspi-config`` tool or manually by adding ::