What a visual effect this code do?
Posted: Mon Jun 29, 2020 4:34 pm
Hey guys!
I'm translating the MicroPython tutorial for ESP8266 to russian language right now and I have a problem with this part (from here):
I know just really basics in programming and I don't have an ESP8266 chip and an APA102 LEDs so I can't check it for myself.
So can you please explain me what do this code do? Does it force the LEDs to change their color through all the rainbow colors and then fade out? Or the rainbow colors just repeatively change each other without fading out? Does the colors move across the strip during color changing (the "offset each pixel" phrase in the description means just like that, right?).
Or maybe it's too much to ask but it would be really nice if you make a little video of what visual effect this code do (I mean, if you have an ESP8266 and an APA102).
Please help
I'm translating the MicroPython tutorial for ESP8266 to russian language right now and I have a problem with this part (from here):
Code: Select all
# Demo 3: Fade all pixels together through rainbow colours, offset each pixel
for r in range(5):
for n in range(256):
for i in range(strip.n):
strip[i] = wheel(((i * 256 // strip.n) + n) & 255, brightness)
strip.write()
time.sleep_ms(25)
So can you please explain me what do this code do? Does it force the LEDs to change their color through all the rainbow colors and then fade out? Or the rainbow colors just repeatively change each other without fading out? Does the colors move across the strip during color changing (the "offset each pixel" phrase in the description means just like that, right?).
Or maybe it's too much to ask but it would be really nice if you make a little video of what visual effect this code do (I mean, if you have an ESP8266 and an APA102).
Please help