Help with the Larson Scanner Shades

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
manofsteele21
 
Posts: 5
Joined: Tue Aug 07, 2018 5:49 pm

Help with the Larson Scanner Shades

Post by manofsteele21 »

Hello,

I am having some issues with wiring or coding this project. To preface I am using the Gemma M0, a 60 NeoPixel LED(Picture attached), and circuitpython for the code. The blinking code provided from the tutorial page on CircuitPython works, but any code referencing the NeoPixels does not work. The way I have it wired to the Gemma M0 is (Gemma M0 --> NeoPixel) GND-->GND, D1-->DIN, Vout --> 5V. I changed my NeoPIxel count in the code to the correct amount connected and it is wired on the correct side or the arrow. I have also tried the Arduino IDE as well with no such luck.

Link to project: https://learn.adafruit.com/larson-scann ... s/overview
code used:

Code: Select all

import time
 
import board
import neopixel
 
numpix = 11  # Number of NeoPixels
pixpin = board.D1  # NeoPixels pin. For Gemma M0 = D1, Trinket M0 = D4
strip = neopixel.NeoPixel(pixpin, numpix, brightness=1, auto_write=False)
pos = 0  # position
direction = 1  # direction of "eye"
 
while True:
    strip[pos - 2] = ([16, 0, 0])  # Dark red
    strip[pos - 1] = ([128, 0, 0])  # Medium red
    strip[pos] = ([255, 48, 0])  # brightest
    strip[pos + 1] = ([128, 0, 0])  # Medium red
 
    if (pos + 2) < numpix:
        # Dark red, do not exceed number of pixels
        strip[pos + 2] = ([16, 0, 0])
 
    strip.write()
    time.sleep(0.03)
 
    # Rather than being sneaky and erasing just the tail pixel,
    # it's easier to erase it all and draw a new one next time.
    for j in range(-2, 2):
        strip[pos + j] = (0, 0, 0)
        if (pos + 2) < numpix:
            strip[pos + 2] = (0, 0, 0)
 
    # Bounce off ends of strip
    pos += direction
    if pos < 0:
        pos = 1
        direction = -direction
    elif pos >= (numpix - 1):
        pos = numpix - 2
        direction = -direction
Thanks
Attachments
NeoPixel LED.PNG
NeoPixel LED.PNG (121.93 KiB) Viewed 210 times

User avatar
oesterle
 
Posts: 806
Joined: Tue Sep 17, 2013 11:32 pm

Re: Help with the Larson Scanner Shades

Post by oesterle »

Hi, manofsteele21.

Can you post a photo(s) of your project, especially connections?

Eric

User avatar
manofsteele21
 
Posts: 5
Joined: Tue Aug 07, 2018 5:49 pm

Re: Help with the Larson Scanner Shades

Post by manofsteele21 »

Thanks Eric,

It is a lot messier than it was, I have tried a handful of different combos. Gonna get some fresh wires moving forward however. I believe I have a RGBW strip, but when I contacted support they said is was the 60 NeoPixel RGB strip I ordered.
Attachments
Wiring.PNG
Wiring.PNG (386.77 KiB) Viewed 207 times

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

Re: Help with the Larson Scanner Shades

Post by caitlinsdad »

You might be in the same situation as this viewtopic.php?f=51&t=139272
Bottom line, make sure you have the latest Circuit Python and libraries installed on your Gemma M0. You should be able to run that same Larson scanner code. You might need to change the strip.write() command to strip.show() which is what I've used. RGBW neopixels are distinguished as having a yellow half moon shape element on the neopixel lens so you have RGB only there - also no mods to the RGB neopixel code needed. Good luck.

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

Re: Help with the Larson Scanner Shades

Post by caitlinsdad »

also try to name the pin board.A0 if board.D1 doesn't do anything. I'm also trying to get the hang of Circuit Python's quirks.

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

Re: Help with the Larson Scanner Shades

Post by caitlinsdad »

also try starting out with brightness=.1 or .3 With it at 1, that is full brightness and the strip probably putting a heavy load on the Gemma power - maybe you are getting the dotstar on the board to turn red as an indicator of power overload error.

User avatar
manofsteele21
 
Posts: 5
Joined: Tue Aug 07, 2018 5:49 pm

Re: Help with the Larson Scanner Shades

Post by manofsteele21 »

Which library would I need to import?
I am using this page to download the latest files: https://github.com/adafruit/Adafruit_Ci ... g/20180810
I tried your changes as well and it just switches between a blue light or a bright almost white light on the board.

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

Re: Help with the Larson Scanner Shades

Post by caitlinsdad »

Hopefully you installed the latest Circuit Python version 3.0 on your board. Download the board-3 zip file. Unzip that and copy the folder to your circuitpy directory on the board. You may have to rename it so it is just "lib"

User avatar
manofsteele21
 
Posts: 5
Joined: Tue Aug 07, 2018 5:49 pm

Re: Help with the Larson Scanner Shades

Post by manofsteele21 »

I do have the latest version downloaded from: https://github.com/adafruit/circuitpyth ... /tag/3.0.0
I cannot copy the whole lib from the zip file because it is too large and I am having trouble figuring out which .mpy to use other than the neopixel.mpy

User avatar
manofsteele21
 
Posts: 5
Joined: Tue Aug 07, 2018 5:49 pm

Re: Help with the Larson Scanner Shades

Post by manofsteele21 »

Got it working!
My soldering was awful and once I re-soldered it, it was working just fine.
Thanks to everyone that commented.

User avatar
oesterle
 
Posts: 806
Joined: Tue Sep 17, 2013 11:32 pm

Re: Help with the Larson Scanner Shades

Post by oesterle »

Even after I'd soldered a bunch of projects, I learned a lot from the beautiful short video at Collin's Lab: Soldering.

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

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