]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
kinder neopixel error
authorladyada <limor@ladyada.net>
Sat, 1 Dec 2018 06:23:33 +0000 (01:23 -0500)
committerYour Name <you@example.com>
Sat, 1 Dec 2018 06:41:22 +0000 (06:41 +0000)
src/adafruit_blinka/microcontroller/raspi_23/neopixel.py

index 3a92c607ded7a30a6f25f18e973f4b1266549950..3993cee36351e947aeefd598451fd6588310b0a0 100644 (file)
@@ -59,6 +59,8 @@ def neopixel_write(gpio, buf):
     
         resp = ws.ws2811_init(_led_strip)
         if resp != ws.WS2811_SUCCESS:
     
         resp = ws.ws2811_init(_led_strip)
         if resp != ws.WS2811_SUCCESS:
+            if resp == -5:
+                raise RuntimeError("NeoPixel support requires running with sudo, please try again!")
             message = ws.ws2811_get_return_t_str(resp)
             raise RuntimeError('ws2811_init failed with code {0} ({1})'.format(resp, message))
         atexit.register(neopixel_cleanup)
             message = ws.ws2811_get_return_t_str(resp)
             raise RuntimeError('ws2811_init failed with code {0} ({1})'.format(resp, message))
         atexit.register(neopixel_cleanup)