M0 and WS2811 Wiring

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
DazednConfused
 
Posts: 36
Joined: Fri Dec 09, 2022 2:48 pm

M0 and WS2811 Wiring

Post by DazednConfused »

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
Attachments
20230317_172632.jpg
20230317_172632.jpg (887.95 KiB) Viewed 106 times

User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: M0 and WS2811 Wiring

Post by dastels »

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

User avatar
DazednConfused
 
Posts: 36
Joined: Fri Dec 09, 2022 2:48 pm

Re: M0 and WS2811 Wiring

Post by DazednConfused »

I'm not exactly sure what a digital output connection is

User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: M0 and WS2811 Wiring

Post by dastels »

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

User avatar
DazednConfused
 
Posts: 36
Joined: Fri Dec 09, 2022 2:48 pm

Re: M0 and WS2811 Wiring

Post by DazednConfused »

Could you also look at the code?

User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: M0 and WS2811 Wiring

Post by dastels »

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

User avatar
DazednConfused
 
Posts: 36
Joined: Fri Dec 09, 2022 2:48 pm

Re: M0 and WS2811 Wiring

Post by DazednConfused »

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)

User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: M0 and WS2811 Wiring

Post by dastels »

What is this? Textified Makecode??

Dave

User avatar
DazednConfused
 
Posts: 36
Joined: Fri Dec 09, 2022 2:48 pm

Re: M0 and WS2811 Wiring

Post by DazednConfused »


User avatar
dastels
 
Posts: 15662
Joined: Tue Oct 20, 2015 3:22 pm

Re: M0 and WS2811 Wiring

Post by dastels »

Ah. Makecode isn't my thing.

Looks like you're getting some help in the other thread.

Dave

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”