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

Thread: Setting up a Teensy 3.6 OctoAdapter, Sd card, display with button video switching

  1. #1

    Setting up a Teensy 3.6 OctoAdapter, Sd card, display with button video switching

    Ok, so I currently have a 35x8 display working, which I intend to extend into 1k LEDs, although I have come across several problems.

    - I cannot work out how to have the data exported by the Octo into the LEDs correctly aligned with the arrangement of the LEDs.
    When using the Example>Octows2811b>Rainbow from the Arduino app running on my teensy I have to increase the led per row up to 70 so that it'll register every led and even then the rainbow melts into itself as the led strips are running the animation in opposite direction to one another?
    Also for the life of me I cannot find what values I change in the Rainbow code to alter the cycle speed or the phase shift?
    I need any kind of guide or resources on how the coding works for the orientation of the LEDs,

    */

    #include <OctoWS2811.h>

    const int ledsPerStrip = 70;

    DMAMEM int displayMemory[ledsPerStrip*6];
    int drawingMemory[ledsPerStrip*6];

    const int config = WS2811_GRB | WS2811_800kHz;

    OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);

    int rainbowColors[180];


    void setup() {
    pinMode(1, OUTPUT);
    digitalWrite(1, HIGH);
    for (int i=0; i<180; i++) {
    int hue = i * 2;
    int saturation = 100;
    int lightness = 50;
    // pre-compute the 180 rainbow colors
    rainbowColors[i] = makeColor(hue, saturation, lightness);
    }
    digitalWrite(1, LOW);
    leds.begin();
    }


    void loop() {
    rainbow(10, 2500);
    }


    // phaseShift is the shift between each row. phaseShift=0
    // causes all rows to show the same colors moving together.
    // phaseShift=180 causes each row to be the opposite colors
    // as the previous.
    //
    // cycleTime is the number of milliseconds to shift through
    // the entire 360 degrees of the color wheel:
    // Red -> Orange -> Yellow -> Green -> Blue -> Violet -> Red
    //
    void rainbow(int phaseShift, int cycleTime)
    {
    int color, x, y, offset, wait;

    wait = cycleTime * 1000 / ledsPerStrip;
    for (color=0; color < 180; color++) {
    digitalWrite(1, HIGH);
    for (x=0; x < ledsPerStrip; x++) {
    for (y=0; y < 8; y++) {
    int index = (color + x + y*phaseShift/2) % 180;
    leds.setPixel(x + y*ledsPerStrip, rainbowColors[index]);
    }
    }
    leds.show();
    digitalWrite(1, LOW);
    delayMicroseconds(wait);
    }
    }




    -When I extend the LEDs to larger than 8 strips how will I code programs running on the teensy so that 1k LEDs are all running off of one teensy like in this project

    https://community.arm.com/iot/embedd...nd-development

    When I was reading some of the resources on the octo and the teensy it seemed that you could only have 8 strips connected to the teensy which I would have thought would have limited the size of the display, unless all 8 of the strips zig zag into one another so that the display can be any size and shape (up to 1k) but if that's the case how would I code the videotosd or any led library so that it could run the video correctly given such a crazy display, also if i were to make a sphere or any non regular shape with LEDs how would I write the code so that the teensy sent data the correct way to give a correct image?

    Also I intend to have video run off an sd card once I code the teensy orientation correctly,
    -What Video format can run off an sd card through a teensy. Does mp4 work? How about .mov or .avi? Do I have to use .bin? What format works best?
    Is there a sd card size limit?
    -How would I code VideotoSd so that I can alternate video files with the button on the teensy?
    How would I hook up a wired remote so I can play pause and skip files to play? Should I look into a wifi remote? Do Wifi remotes have a noticeable lag from when you press play?

    If you have any guidence to any of these questions I will be incredibly thankful, I will happily include pictures of the wiring and the project if that would help with any specific details or clear up any detail I may not have explained clearly.

    Sunbeamdreaming

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    19,508
    Look at the Fire and SpectrumAnalyzer examples. They show how to use a xy() function to map normal x, y coordinates onto the led index numbers.

  3. #3
    I still do not know how to code my led display correctly and what parameters in the code I can change to rectify this.
    So currently I still have 35x8 I will later have 35 x 35 hopefully

    In the code for Fire there is the section

    // The display size and color to use
    const unsigned int width = 35;
    const unsigned int height = 8;

    But when I fill this out correctly only the 1st and 5th line light up at all
    When I increase the width by x4 they all light up but the pattern is wrong.
    Are there other parameters I need to change to rectify this? My data set up is the same as this project
    https://community.arm.com/iot/embedd...nd-development

    Same with rainbow
    const int ledsPerStrip = 35

    and spectrum analyser
    // The display size and color to use
    const unsigned int matrix_width = 35;
    const unsigned int matrix_height = 8;
    const unsigned int myColor = 0x400020;

    What are the other parameters I need to change in the code?

  4. #4
    Junior Member
    Join Date
    Feb 2019
    Posts
    3
    Hi, did you ever solve this issue and if so can you post your code etc.

    Looks like we are working on similar projects and being able to replicate your work would be a huge help!

    D.

Posting Permissions

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