Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6037

General programming discussion • Re: 24 Minute Sun Simulation

$
0
0
I have finally managed to learn something to make these lights work, sort of.
I found this code:

from machine import Pin
from neopixel import NeoPixel

pin = Pin(2, Pin.OUT)
np = NeoPixel(pin, 8, timing=(300, 1090, 1090, 320)) # h0, l0, h1, l1
np[0] = (0, 0, 255) # blue
np[1] = (0, 255, 0) # red
np[2] = (255, 0, 0) # green
np.write()

Every time I press "run" in thonny I get a different result. I don't think I've ever gotten blue, red, and green as intended. Those three colors light up but it's two reds and a blue or two greens and a blue. Or the third one just doesn't work. I feel like the lights should do the same things every time instead of almost random. Any ideas as to why this is happening?

i have these wired like this:
Negative wire in VSYS
Power in 3V3
Main Data in GP2
Backup Data in a Ground between GP5 AND GP6
That's, uh, a very creative wiring standard. Can you post a link to the LED strips you actually bought, and the power supply?

Statistics: Posted by ame — Fri Nov 29, 2024 3:48 am



Viewing all articles
Browse latest Browse all 6037

Latest Images

Trending Articles



Latest Images