Python Forum

Full Version: Trying to move a RGB ledstrip with slider of my phone in almost "realtime" help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there,


I am trying to have a RGB led on a 50 rgb ledstrip to move as my finger moves with the slider on my app.
the sliders min & max are.
Min = 0
Max = 49
This means I have 50 RGB LEDs.
So the resolution is good.

I am trying to do this in python but can't figure out how.
The code below is a standard colorwipe of the neopixel library
And as you can see I am doing nothing yet with the data => slider value

def colorWipe(strip, color, data):
    """Wipe color across display a pixel at a time."""
      
    for i in range(strip.numPixels()):
         strip.setPixelColor(i, color)
         strip.show()
         time.sleep(50/1000.0)
Calling the function

colorWipe(strip, Color(0,255,0), incomingData)
So I am hardcoding for now the color red.
Main priority is to have 1 rgb led follow my finger aka slider on the app.

Can somebody point me in the right direction?