I'm not sure how to wire the Gemma M0 and WS2811. The WS2811 wires are: red- 5V, White-dat, blue-GND
There also the single blue and red wires sticking out too.
I've tried putting blue to GND and red to Volt. The LED flickers but doesn't stay on
M0 and WS2811 Wiring
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- DazednConfused
- Posts: 36
- Joined: Fri Dec 09, 2022 2:48 pm
M0 and WS2811 Wiring
- Attachments
-
- 20230317_172632.jpg (887.95 KiB) Viewed 106 times
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: M0 and WS2811 Wiring
You need to connect the data wire to a digital output connection and use that in the code when you create the NeoPixel object. See https://learn.adafruit.com/adafruit-neopixel-uberguide.
Dave
Dave
- DazednConfused
- Posts: 36
- Joined: Fri Dec 09, 2022 2:48 pm
Re: M0 and WS2811 Wiring
I'm not exactly sure what a digital output connection is
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: M0 and WS2811 Wiring
In the case of the Gemma it's one of D0, D1, or D2. Pick one, attach the data line of the strip and use it to initialize the NeoPixel object.
Dave
Dave
- DazednConfused
- Posts: 36
- Joined: Fri Dec 09, 2022 2:48 pm
Re: M0 and WS2811 Wiring
Could you also look at the code?
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: M0 and WS2811 Wiring
What code? You haven't posted or mentioned any. The the strandtest example that's with the C++/Arduino NeoPixel library. Change the code to use whichever of D0, D1, D2 you connect the data signal to.
Dave
Dave
- DazednConfused
- Posts: 36
- Joined: Fri Dec 09, 2022 2:48 pm
Re: M0 and WS2811 Wiring
toggle = 0
strip = light.create_strip(pins.D1, 7)
strip.set_brightness(80)
pixel.set_color(0x000000)
gradient = 0
hue = gradient
def on_forever():
global gradient, hue
gradient += 50
if gradient >= 255:
gradient = 0
strip.set_all(0x000000)
pause(5000)
strip.set_all(light.hsv(gradient, 255, 255))
pause(5000)
hue = gradient
forever(on_forever)
def on_forever2():
global hue, toggle
strip.set_pixel_color(0, light.hsv(hue, 255, 255))
strip.move(LightMove.ROTATE, 1)
pause(100)
hue += toggle
if hue >= 75 + gradient:
toggle = -5
elif hue <= gradient:
toggle = 5
forever(on_forever2)
strip = light.create_strip(pins.D1, 7)
strip.set_brightness(80)
pixel.set_color(0x000000)
gradient = 0
hue = gradient
def on_forever():
global gradient, hue
gradient += 50
if gradient >= 255:
gradient = 0
strip.set_all(0x000000)
pause(5000)
strip.set_all(light.hsv(gradient, 255, 255))
pause(5000)
hue = gradient
forever(on_forever)
def on_forever2():
global hue, toggle
strip.set_pixel_color(0, light.hsv(hue, 255, 255))
strip.move(LightMove.ROTATE, 1)
pause(100)
hue += toggle
if hue >= 75 + gradient:
toggle = -5
elif hue <= gradient:
toggle = 5
forever(on_forever2)
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: M0 and WS2811 Wiring
What is this? Textified Makecode??
Dave
Dave
- DazednConfused
- Posts: 36
- Joined: Fri Dec 09, 2022 2:48 pm
- dastels
- Posts: 15662
- Joined: Tue Oct 20, 2015 3:22 pm
Re: M0 and WS2811 Wiring
Ah. Makecode isn't my thing.
Looks like you're getting some help in the other thread.
Dave
Looks like you're getting some help in the other thread.
Dave
Please be positive and constructive with your questions and comments.