Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 10 of 10

Thread: Cannot light WS2812's and may need a simple pointer: Teensy 3.2 + Prop Shield

  1. #1

    Cannot light WS2812's and may need a simple pointer: Teensy 3.2 + Prop Shield

    Hi all,
    I've just started to tinker with a Teensy 3.2 for the first time after finding out that the Teensy + Prop Shield is perfect for my WS2812 project. I've soldered the prop shield to the Teensy, tested it out to make sure there weren't any issues with my solder joints, and proceeded to hook up the 5V, GND, and CLK signals to the corresponding 5, C, and D on the prop shield. I am now trying to run, just as a test, FirstLight and I'm not getting anything lit up. The strand I'm using is a known working strand of 21 WS2812s, which I know is too many to power all at once but shouldn't be for running FirstLight. I believe I have set the parameters properly...

    Code:
    // How many leds are in the strip?
    #define NUM_LEDS 21
    
    // Data pin that led data will be written out over
    #define DATA_PIN 11
    And I've uncommented the correct LED line...

    Code:
    // FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
     FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
    I have checked my connections and there is 5V across the LED rails so it's getting power...so the only thing that could be wrong is the clock signal. I hope I'm just missing something exceedingly stupid. Thanks in advance for your assistance.

  2. #2
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    1,612
    The prop shield uses pin 7 to enable the LED AND buffers, and pin 11 to drive the LED string. You didn't provide a runnable sketch as the forum rule requests. Have you tried the small LED example on https://www.pjrc.com/store/prop_shield.html

    can you attach photo of your wiring.
    Last edited by manitou; 07-12-2018 at 02:30 PM.

  3. #3
    Hey Manitou,
    First, thank you so much for your quick reply. As I said, I'm sure this was something stupid, and it was. I first misunderstood what I read about Pin 7 and thought it only needed to be high for the APA102. I also misunderstood which pin to use for my data_pin...that needs to be 13 because the WS2812 just uses CLK, not Data. Everything works now, but here's the full program in case anyone finds this in the future.

    Code:
    #include "FastLED.h"
    #define NUM_LEDS 21
    #define DATA_PIN 13
    
    CRGB leds[NUM_LEDS];
    
    void setup() {
       	delay(2000);
           FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
           pinMode(7, OUTPUT);
           digitalWrite(7, HIGH);  // enable access to LEDs
    }
    
    
    void loop() {
       // Move a single white led 
       for(int whiteLed = 0; whiteLed < NUM_LEDS; whiteLed = whiteLed + 1) {
          // Turn our current led on to white, then show the leds
          leds[whiteLed] = CRGB::White;
    
          // Show the leds (only one of which is set to white, from above)
          FastLED.show();
    
          // Wait a little bit
          delay(100);
    
          // Turn our current led back to black for the next loop around
          leds[whiteLed] = CRGB::Black;
       }
    }

  4. #4
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,797
    FWIW, you could use either pin 13 or pin 11 as the data pin for the WS2812 LEDs, or you could use pin 13 for one strand and pin 11 for another strand in parallel (you would need separate CRGB arrays for each set of LEDs). Now for APA102 devices you need both 13 and 11 to drive one strand of lights. I tend to use pin 11 so that I can continue to use pin 13 to drive the on-board LED.

    If you want to use the flash memory on the prop shield, you will need to set pin 7 LOW and pin 6 HIGH while you access the flash memory, and set pin 7 HIGH and pin 6 LOW to access the LEDs.

  5. #5
    Thanks for your reply Michael. For the program above, switching the pin from 13 to 11 doesn't seem to work. Can you explain?

    Regarding the flash memory, thank you for that info. I'm sure I'm going to use it when I start writing bigger programs.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,502
    Maybe show us a photo of how you've actually connected the wires? This may be a simple mistake or misunderstanding which we could help clear up, if we're able to actually see it.

  7. #7
    Absolutely Paul, thank you. As I mentioned, I have it working just fine right now on pin 13, but Michael's pin 11 suggestion doesn't work. The only soldering I've even done is pin to pin from the Teensy 3.2 to the prop board (I need to clean these up, looking at them now) and then the 5V, GND, Data, and Clk signals (the WS2812s don't use the Data Pin, I just did that to give the cable more support).

    5V - Red
    Data - Yellow
    CLK - Green
    GND - Blue

    Thanks!
    Click image for larger version. 

Name:	IMG_7357.jpg 
Views:	17 
Size:	63.4 KB 
ID:	14202

  8. #8
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,797
    Just to be clear, if you change the program to use pin 11, you also have to change the data wire. In the back of the prop shield, there are 4 pins (G for ground, C that is connected to pin 13, D that is connected to pin 11, and 5 that is connected to VIN/5v input).

    Note, I do not use the FastLed library, so I don't know if it has other issues that might prevent pin 11 from being used. Also you might want to check whether pin 11 is properly soldered to the board (BTDT).

  9. #9
    Ahhh...ok gotcha. That would be why it isn't working . Problem solved there too then. And I'll check the solder joint too (I did this late last night with not much illumination and my solder joints show it). Thank all of you for answering a bunch of really dumb questions...this was an enormous help and I really appreciate it.

  10. #10
    Manitou, MichaelMeissner, and PaulStoffregen, I want to thank you all again for your help. I know people post questions, get help, then disappear, so I wanted to show y'all what it allowed me to do in the last two weeks instead . I'm just showing a single color so you can see what it's doing better, but I have all kinds of crazy patterns and gradients programmed in at this point.

    *673 WS2812 LEDs arranged in a hexagonal array in a custom coat
    *Teensy 3.2 + Prop Shield + Sparkfun ADMP401 MEMS mic
    *powered by two 5200mAh lipos
    *user controlled using two buttons (pattern +/ -, on/off, sound reactivity on/off, sound sensitivity +/-) and a 10k pot (overall brightness +/-)
    *OLED display showing current mode (TBD)
    *bluetooth iPhone control (TBD)

    Thanks y'all!

    Last edited by austin519; 07-28-2018 at 09:05 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •