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

Thread: Octows2811--looping an led strip back on itself to create "more" strips on one pin?

  1. #1
    Junior Member
    Join Date
    Sep 2020
    Posts
    2

    Octows2811--looping an led strip back on itself to create "more" strips on one pin?

    Hello, I'm new here. I'm trying to build a project that's 32x43 LEDs controlled by the Teensy3.2 and Octows2811 Adapter with the purpose of just being a basic lightshow--I'm not planning to tie video into it. I'm aware that the Octo ideally adapts the teensy to 8 strips of equal length, but I'm hoping to avoid using multiple teensys and multiple octos.

    Is it possible to take a single strip on a single pin and alter the code such it can be divided into multiple sections to basically mimic having more individual strips on that single pin? The strip would be physically broken up into multiple sections, but electrically still be wired in series. If that makes sense. Is there an easy - ish way to achieve my goals?

    Thanks!

  2. #2
    Senior Member
    Join Date
    Jul 2020
    Posts
    173
    The advantage of using multiple pins is that it takes time to clock the colors down the chain of LEDs, and if one group of them is extremely long it can impact framerate. You are proposing to run over 1,000 LEDs on one pin. If my math is not wrong, 32*43 (resolution) = 1,376 pixels, * 8 (bits/byte) * 3 (bytes/color) = 33,024 bits, * 3 (symbols/bit) = 99,072 symbols to transmit an RGB value to every NeoPixel. * 400 (nanoseconds/symbol) = 39,628,800 nanoseconds, or 39.6288 milliseconds per "frame". There is more delay after this (you have to transmit a series of low symbols to indicate "latch" and dump the registers to the PWM generators inside the LEDs) but I forget how long that is. In any case, I think you might be able to get ~25 frames/sec in this manner, maybe less (and that assumes my math is correct.)

    Don't forget that you need external power supply to provide enough current to drive that many LEDs, unless you limit the max brightness in software. You will not be able to pull enough current over a USB cable by itself.

  3. #3
    Junior Member
    Join Date
    Sep 2020
    Posts
    2
    Thank you for your reply. Apologies for the confusion, but the 1 pin scenario was only an example to relay the end-goal. I do intend to use 8 pins, but the goal was to use each of those pins to power multiple strips that are electrically wired together in series (effectively making them one long strip, but they'd be arranged in a fixture such that they appear as multiple). If I use the 8 pins available via the Octo, then I'd be looking at each individual pin powering 4x32 LEDs for just 128 LEDs per pin.

    I got the idea from this person's project: https://imgur.com/gallery/tSoa2W6

    Within his documentation, it shows that he basically divides his total project area into 8 "sections" of 6 strips per section. I'm not all that great at coding--and please note that I don't intend to make an audio visualizer as he does--so I haven't been able to parse through the code to the point where I understand how he uses a single pin to drive multiple strips (even though, yes, they are technically just one long strip).

    Perhaps this hastily drawn diagram will help with what I'm trying to accomplish: Click image for larger version. 

Name:	Drawing1.jpg 
Views:	15 
Size:	22.3 KB 
ID:	21834

    Thanks again for your time.

  4. #4
    Senior Member
    Join Date
    Feb 2016
    Location
    Australia
    Posts
    271
    Hello Smitj11.
    I would like to confirm that what you want as shown in your WANT picture is what you want.
    I'm thinking you don't want to logically code some strip of leds from 0 to 32 and have the same sequence displayed on two strips? (or have groups of 4 32 strips all the same) Maybe you do... But I'm thinking your want to code that looks something like LED1[20]=red.. LED2[30]=green to turn the 21st led in your first strip red and your 31st led in your second strip green with the physical strip wired as shown and without having to manually work out the led number everywhere. As for the above exabple LED[20]=red, LED[33]=green

    I would like to reccomend the way I would do it to see how others would.

    Is the array notation in your pic symbolic or are you using fastled for this display using CRGB array.

    I'm interested in how you want to map your display logically. You can then create code to work with this logical abstraciton and drive your physicall wiring/electrial protocol.

    Note: If i come off sounding like a nob it's because I may be using terms here incorrectly. Please correct me.

    Anyway, the short answer to any interpretation of your question in the first post is Yes.

  5. #5
    Senior Member
    Join Date
    Jul 2020
    Posts
    173
    Quote Originally Posted by Smitj11 View Post
    Perhaps this hastily drawn diagram will help with what I'm trying to accomplish: Click image for larger version. 

Name:	Drawing1.jpg 
Views:	15 
Size:	22.3 KB 
ID:	21834
    Oh, okay, so you want sort of a U-shaped topology where it's reversing direction (maybe multiple times.)

    What he's doing is reversing the order of colors in every other row. In your example, you would have an array of colors 64 elements long. Just before transmission, you will copy the last 32 elements to a temp array backwards, so that the last is the first, the first is the last, etc., and then copy from the temp array back to what you are going to transmit.

    There are other ways to do it, like exchange-in-place (no temp array) but that is the general idea. Exchange-in-place is more efficient, but slightly harder to code because you have to account for whether the array has an even or odd number of elements.

    For simplicity's sake, imagine you are doing this, but with two 8-element strips:
    Code:
     Input: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15   <-- Makes sense to you
    Output: 0, 1, 2, 3, 4, 5, 6, 7, 15, 14, 13, 12, 11, 10, 9, 8   <-- Makes sense to the layout of the LEDs

Tags for this Thread

Posting Permissions

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