title: How to run Neopixel without sudo permissions for use in an alexa app
body: <p>I am creating an Alexa app that will allow the user to turn on a set of NeoPixels (WS2812) LEDs using a simple voice command. The app is hosted on a raspberry pi 4 and currently works for turning on GPIO pins. The issue I am having is that the code to turn on the NeoPixels needs sudo permissions, so when using the alexa app and it will simply error instead of turning on the lights.</p>
  
  <p>due to the fact that sudo is needed the only way I have been able to run the script is to </p>
  
  <pre><code>sudo python3 LEDTest2.py
  </code></pre>
  
  <p>which works fine</p>
  
  <p>here is the implementation for the alexa app turning on the GPIO pin and calling the python program</p>
  
  <pre><code>@ask.intent('GpioIntent', mapping = {'status':'status'})
  def Gpio_Intent(status,room):
      GPIO.setwarnings(False)
      GPIO.setmode(GPIO.BCM)    
      GPIO.setup(17,GPIO.OUT)
      if status in STATUSON:
          GPIO.output(17,GPIO.HIGH)
          LEDTest2.func() ###Problem Point###
          return statement('turning {} lights'.format(status))
  </code></pre>
  
  <p>This works fine for turning on the GPIO pin </p>
  
  <p>Here is the LEDTest2.func() </p>
  
  <pre><code>
  import board
  import neopixel
  import time
  pixels = neopixel.NeoPixel(board.D18,60)
  
  def func():
      print("func() in LEDtest2.py")
      pixels.fill((255, 197, 143))
      time.sleep(5)
      pixels.fill((0,0,0))
  
  if __name__ == "__main__": #same as file one
      print("LEDtest2.py is being run directly")
      for x in range(2): 
          pixels.fill((0, 255, 0))
          time.sleep(.1)
          pixels.fill((0, 0, 0))
          time.sleep(.1)
  
  
  else:
      print("LEDtest2.py is being imported into another module")
  
  </code></pre>
  
  <p>how can i run this code without needing sudo permissions? is there an alternative way to control WS2812 LEDs using python? </p>
  
  <p>Edit: Just to clarify i am not having any problems with the GPIO pins it is the NeoPixel library that cannot be used without sudo permissions  </p>