gemma M0 neopixel

Wearable electronics: boards, conductive materials, and projects from Adafruit!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Spica1
 
Posts: 4
Joined: Mon Aug 06, 2018 6:33 pm

gemma M0 neopixel

Post by Spica1 »

Hi I have a Gemma M0 board that when I load a code for a 8 pixel strip nothing lights up. Coding test ok but nothing happens. Is there a separate library for these?
https://www.adafruit.com/product/1426

User avatar
Franklin97355
 
Posts: 23911
Joined: Mon Apr 21, 2008 2:33 pm

Re: gemma M0 neopixel

Post by Franklin97355 »

It should use the Neopixel library. Can you post a picture of your connections? What code are you running?

User avatar
Spica1
 
Posts: 4
Joined: Mon Aug 06, 2018 6:33 pm

Re: gemma M0 neopixel

Post by Spica1 »

I used codes from Github and here have been trying a few different ones since I dont even get one color. I have tried using A1 D2 and D1 as outputs and no change.

# CircuitPython demo - NeoPixel

import time

import board
import neopixel

pixpin = board.D1
numpix = 10

strip = neopixel.NeoPixel(pixpin, numpix, brightness=0.3, auto_write=False)


def wheel(pos):
# Input a value 0 to 255 to get a color value.
# The colours are a transition r - g - b - back to r.
if (pos < 0) or (pos > 255):
return (0, 0, 0)
if pos < 85:
return (int(pos * 3), int(255 - (pos * 3)), 0)
elif pos < 170:
pos -= 85
return (int(255 - pos * 3), 0, int(pos * 3))
else:
pos -= 170
return (0, int(pos * 3), int(255 - pos * 3))


def rainbow_cycle(wait):
for j in range(255):
for i in range(len(strip)):
idx = int((i * 256 / len(strip)) + j)
strip = wheel(idx & 255)
strip.write()
time.sleep(wait)


while True:
strip.fill((255, 0, 0))
strip.write()
time.sleep(1)

strip.fill((0, 255, 0))
strip.write()
time.sleep(1)

strip.fill((0, 0, 255))
strip.write()
time.sleep(1)

rainbow_cycle(0.001) # rainbowcycle with 1ms delay per step

User avatar
caitlinsdad
 
Posts: 627
Joined: Fri Feb 24, 2012 4:23 pm

Re: gemma M0 neopixel

Post by caitlinsdad »

I know that Circuit Python is in constant development so I have run across sample code that may not work with updated versions or used on different boards that the code was not specifically written for.

Try changing the strip.write() command to strip.show()

Try the different pin names. Hope it works then. Good luck.

User avatar
Spica1
 
Posts: 4
Joined: Mon Aug 06, 2018 6:33 pm

Re: gemma M0 neopixel

Post by Spica1 »

Been trying all the pin outs and still no pixel even lights up. I tried a simple LED on the outputs and they do work but just with neopixels I am having problems.

User avatar
caitlinsdad
 
Posts: 627
Joined: Fri Feb 24, 2012 4:23 pm

Re: gemma M0 neopixel

Post by caitlinsdad »

If you go through the Gemma M0 guide, it may help to at least get the onboard Dotstar working and then get external neopixels working. https://learn.adafruit.com/adafruit-gemma-m0?view=all

You might want to post a picture of your setup to see how things are wired up. Neopixels need to be hooked up correctly to work. Do you have a stick of neopixels or a cut strip of neopixels?

User avatar
Spica1
 
Posts: 4
Joined: Mon Aug 06, 2018 6:33 pm

Re: gemma M0 neopixel

Post by Spica1 »

IT is the 8 pixel stick and got them to work. I replaced the lib folder with new ones one at at time and that fixed the issue.
Thanks for all the tips!

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

Return to “Wearables”