Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Converting code
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Converting code

by janesmouse on Mon Mar 30, 2020 9:52 am

Hi,

Pretty new at using Circuitpython
I am trying to get the Fancyled code used in the Glow Fur Scarf project to work on the CPB board using the board Neopixels. I also want to use tapping to change patterns. How do I change Gemma M0 specific code to work on the CPB, my attempts so far are failing.

Thanks in advance

janesmouse
 
Posts: 2
Joined: Mon Mar 30, 2020 9:47 am

Re: Converting code

by dastels on Mon Mar 30, 2020 10:22 am

What have you tried, and what is it doing (or not doing)?

Dave

dastels
 
Posts: 3781
Joined: Tue Oct 20, 2015 3:22 pm

Re: Converting code

by janesmouse on Mon Mar 30, 2020 11:51 am

Hi Dave,

I have changed the reference for the neopixels to
pixels = neopixel.NeoPixel(board, 10, brightness=0.3, auto_write=False)
and added the board and Neopixel libraries also changed references for strip to pixels and num_leds to 10.

Not sure if all of that has worked as I can;t get my head around the button press code well enough to change it to use the accelerometer Tap to trigger pattern change.

Emily

janesmouse
 
Posts: 2
Joined: Mon Mar 30, 2020 9:47 am

Re: Converting code

by dastels on Mon Mar 30, 2020 1:01 pm

The first argument to neopixel.Neopixel should be board.NEOPIXEL which is the pin connected to the NeoPixels. Search https://learn.adafruit.com/ for projects using digital inputs and the accelleroneter. Specifically, look at the CPB tutorial: https://learn.adafruit.com/adafruit-circuit-playground-bluefruit

Dave

dastels
 
Posts: 3781
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.