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

Thread: fastled with Teensy 3.2

  1. #1
    Junior Member
    Join Date
    Nov 2018
    Posts
    9

    fastled with Teensy 3.2

    Hello. This is my first project with the Teensy (Using arduino for about a year). I'm making 5 small infinity mirrors with the letters to my niece's name inside. 170 LED's. I have pin 6 of the teensy connected directly to the LED strip WS2812. Does it matter which pin I use? This setup works great with the adafruit neopixel library. The problem is that I want to use the fastled library. When I use the DemoReel100, it really doesn't work. It looks choppy and barely works, if at all. Only one of the "demo's" really works.

    I am not currently using a resistor on the data line. The idea (in my head) was the 3.3v of teensy might work with the 5v lights with no resister. Is this safe for long term? If the neopixel library works fine, I'm guessing this isn't the problem I'm getting for fastled.

    Any thoughts or criticism greatly appreciated. Thank you.

  2. #2
    Junior Member
    Join Date
    Nov 2018
    Posts
    9
    I've gotten the rough build complete. I need to level the letters, maybe remake the L and E. I still need to get the neopixels to stick better. But here it is.

    Does anyone have or know of example neopixel library sketches? I didn't find what I was looking for on github. I don't have a good grasp on the library using the few examples that come with it.

    Click image for larger version. 

Name:	20181117_080644.jpg 
Views:	48 
Size:	47.1 KB 
ID:	15173

  3. #3
    Senior Member mortonkopf's Avatar
    Join Date
    Apr 2013
    Location
    London, uk
    Posts
    898
    looking good. re neopixel sketches, you can swap the neopixel calls into sketched for fastled lib. The maths in the loops can be used. Depends on what type of lightshow effect you would like. you should be able to use the fasted example code and choose WS2812 or ws2811. Why did you swap from fasted to neopixel lib?

  4. #4
    Junior Member
    Join Date
    Nov 2018
    Posts
    9
    That's a good idea about using the math, thank you. The demo reel of fastled doesn't animate right. It's very choppy, and runs as if it's going super slow. One part of the reel works correctly. When I run it on the arduino mega, it's all good. I just can't get the mega to physically fit anywhere.
    I really want to use the HSV commands of fastled. Maybe if I try a different pin on the teensy?

  5. #5
    Senior Member
    Join Date
    Jan 2013
    Posts
    181
    Quote Originally Posted by BrianFromWI View Post
    I don't have a good grasp on the library using the few examples that come with it.
    Did you see the FastLED documentation? That is the link to the overview. Other topics are on the right side.

    Quote Originally Posted by BrianFromWI View Post
    This is my first project with the Teensy (Using arduino for about a year).
    You will learn some new things and have a lot of fun. Please read the FastLED documentation first (except ESP8266 notes). Then come back and let us discuss the details of your project. Good news is that this type of project (Teensy 3.x + RGB LEDs) is pretty popular and well understood. So, you can potentially get lots of help here. However, each project has many tiny differences. Those differences can matter a lot. So, the more project details are revealed, the better.

    Some advice:
    1. Post your code. Best is the simplest possible sketch that demonstrates the issue.
    2. Show us your circuit. A circuit diagram, pictures of the actual wiring. A diagram of the physical layout of the project: location, general dimensions and sizes of things: LEDs, power supply, Teensy 3.2, other components.
    3. Read the FastLED Documentation.
    4. Use a level-shifter. If you have room for one, consider one of the existing adapter boards that would provide this. Or maybe you prefer to roll your own.

    Best regards.

  6. #6
    Junior Member
    Join Date
    Nov 2018
    Posts
    9
    Thank you for the response. I've been over documentation. Right now, I'm just comparing the demo reel of both libraries. (adafruit / fastled). I only modified the number of led's and pin number.
    For the circuit, it's pretty simple. At this stage, I'm using a 60 amp switching 5v power supply(Vin of teensy). The teensy (data line) is probably about 1.5 feet wire length away from the LED strip. The finished location will be a lot closer. I also have no resister on the data line right now. (2 things not ideal right there) The power to each letter is parallel. The start and stop of each letter is in the top left corner.
    My thought was if one library works flawlessly, why doesn't the other one(as connected, no resistor at 3.3v). I have the octows2811 but it won't fit in the current desired location. It sounds like the lack of level-shifter is my problem. With that said, I have a few solutions. 1)make room for the large octows2811, 2)roll my own level-convertor, 3)use the adafruit library, 4) use an arduino nano.

    I ran out of memory on a previous project for my niece with the nano. That's why I'm trying the teensy, but I fear I set myself up for failure.

    Current desired location for controller.
    Click image for larger version. 

Name:	20181117_215017_resized.jpg 
Views:	30 
Size:	45.8 KB 
ID:	15183

    Previous project with nano and apa-106 LED's. Video is here https://www.youtube.com/watch?v=CGcTEpCWUaM
    Click image for larger version. 

Name:	20180520_113011.jpg 
Views:	23 
Size:	99.3 KB 
ID:	15184
    Last edited by BrianFromWI; 11-18-2018 at 03:33 AM.

  7. #7
    Junior Member
    Join Date
    Nov 2018
    Posts
    9
    Quote Originally Posted by mortonkopf View Post
    looking good. re neopixel sketches, you can swap the neopixel calls into sketched for fastled lib. The maths in the loops can be used. Depends on what type of lightshow effect you would like. you should be able to use the fasted example code and choose WS2812 or ws2811. Why did you swap from fasted to neopixel lib?
    The fastled library isn't working correctly. Actually, I don't doubt the library, I question my application. I have no resistor on data line going straight to LED's from Teensy. If the adafruit library works flawlessly, why doesn't the fastled as well?

  8. #8
    Senior Member
    Join Date
    Jan 2013
    Posts
    181
    I think there are multiple ways to go here.

    I suggest you make a small, simple prototype with just a Teensy 3.2 and a few (say, 6 or so) pixels. No resister needed. No level-shifter needed. Use a short wire for LED Data. This should absolutely work and, if it doesn't, then it is the easiest case to debug.

    How are you powering the Teensy? Have you cut the "5V" Pads?

    I can't see your code or your circuit. I can't do much more without these.

  9. #9
    Senior Member
    Join Date
    Jan 2013
    Posts
    181
    FYI, the Teensy LC is a ARM Cortex-M0+ processor at 48 MHz, 62K Flash, 8K RAM. It includes a 1 channel level-shifter that can "directly drive WS2812/NeoPixel LEDs". Takes up the same space as a Teensy 3.2. It's also inexpensive. It might be an option for you. You could save the 3.2 for another project.

  10. #10
    Senior Member
    Join Date
    Jan 2013
    Posts
    181
    Click image for larger version. 

Name:	IMG_1068.jpg 
Views:	32 
Size:	156.8 KB 
ID:	15191

    My sketch is here:
    Cylon.zip

    I changed it to use pin 6. I also changed the number of LEDs to 8.

    I didn't have a Teensy 3.2 handy so I used a Teensy 3.0. For our purposes, they are the same.

    Does this sketch work for you?

  11. #11
    Junior Member
    Join Date
    Nov 2018
    Posts
    9
    Thank you. I changed to pin 5 and it works with the 8 LEDs. I then changed it to my 170 LEDs and your cyclone code worked great. I put the fastled demo reel on 60 LEDs and it works good. Once I go to 65 LEDs, the LEDs after 65 do some goofy stuff but the first 65 work pretty good. Using 70+ LEDs and nothing works right. I put the fastled demo reel on an arduino mega at 170 LEDs and it works great.
    I was hoping to use some of the demo reel code, that's why I keep bringing that up. So far, everything except the demo reel works on the teensy. Demo reel works on arduino. I might have to upload a video to show what is going on.

    Cyclone code working on 8 LEDs on Teensy
    Click image for larger version. 

Name:	20181119_192956_resized.jpg 
Views:	24 
Size:	189.3 KB 
ID:	15199

    Fastled demo reel working well on the Arduino.
    Click image for larger version. 

Name:	20181119_195421_resized.jpg 
Views:	20 
Size:	116.1 KB 
ID:	15200

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,171
    Oh, looks like I need to dig up a longer strip of LEDs and test FastLED again...

  13. #13
    Junior Member
    Join Date
    Nov 2018
    Posts
    9
    Quote Originally Posted by PaulStoffregen View Post
    Oh, looks like I need to dig up a longer strip of LEDs and test FastLED again...
    Thank you sir.

  14. #14
    Junior Member
    Join Date
    Nov 2018
    Posts
    9
    I attached a picture of what fastled is doing with 170 LEDs. This pictures shows the same thing a video would. It just hangs like this. If I just leave it run, one function does work correctly. After that function, it goes back to being frozen.
    Click image for larger version. 

Name:	20181119_200956_resized.jpg 
Views:	33 
Size:	103.4 KB 
ID:	15203

  15. #15
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,171
    Should I test with the DemoReel100 example? It has a default of 64 LEDs. Is that example with the NUM_LEDS set to 170 enough to reproduce this problem? How long do I need to leave it running to see the issue?

    Or should I try running your code? I see the code on msg #10, but it has NUM_LEDS defined as only 8.

    Please tell me any details I need to know to recreate the problem. Please be specific. Often when I try to recreate a problem things work because some small but important detail was missing.

  16. #16
    Junior Member
    Join Date
    Nov 2018
    Posts
    9
    The DemoReel100 is all you need. After about 70 LEDs, things get goofy. The first time I tried it with 170 LEDs, it was real choppy and seemed to be slow motion. Today it is just frozen until it gets to the working function. It happens right away.

    Details= teensy 3.2, Aclorol WS2812B LEDs 300 pixel strip, Teensy has data pin on 5 and 170 LEDs. Actually... It was slow motion choppy on pin 6, frozen on 5

Posting Permissions

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