Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 26 to 50 of 58

Thread: Gladiator with OctoWS2811 - working example

  1. #26
    Senior Member mortonkopf's Avatar
    Join Date
    Apr 2013
    Location
    London, uk
    Posts
    911
    The Cheriton installation looks great! Really cool. I love how powerful the teensy can be to support arts.

    Yep, start another thread for the video wall. Perhaps there should be a zone on this forum just for Led Projects.

  2. #27
    is there a quick and dirty way (on a mac) to have the data send to multiple teensy controllers? I can get the PixelController software and Glediator to work perfectly on 1 teensy with the octoboard but I would like to essentially clone the same signal and route it to the 2 other boards with the same setup.

  3. #28
    Senior Member mortonkopf's Avatar
    Join Date
    Apr 2013
    Location
    London, uk
    Posts
    911
    Not that I have tried. Might be quickest to give the software developer the question.

  4. #29
    Quote Originally Posted by lightsonsight View Post
    is there a quick and dirty way (on a mac) to have the data send to multiple teensy controllers? I can get the PixelController software and Glediator to work perfectly on 1 teensy with the octoboard but I would like to essentially clone the same signal and route it to the 2 other boards with the same setup.
    Dunno but I split the signal wire into four with an arduino installation and it worked.
    You might want to try that? You might have to raise the voltage to 5v
    Alternatively maybe you could use something like Max to read the artnet data and pipe it out to separate ip addresses.

  5. #30
    Junior Member
    Join Date
    May 2016
    Posts
    1
    this program that i work with works one and it stop i dont know why? can you help me please
    #define WS2812B_pin 8
    #define numberOfLEDs 60
    byte RGB[120];

    void RGB_update(byte LED, byte RED,byte GREEN,byte BLUE);
    void setup() {
    Serial.begin(1000000);
    delay(1000);
    pinMode(WS2812B_pin, OUTPUT);

    }

    int serialGlediator() {
    while (!Serial.available()) {}
    return Serial.read();
    }

    void loop() {
    //while (serialGlediator() != 1) {}
    for (int i=0; i < numberOfLEDs; i++) {
    RGB_update(i,serialGlediator(),serialGlediator(),s erialGlediator());
    }

    }
    void RGB_update(int LED, byte RED, byte GREEN, byte BLUE) {
    // LED is the LED number starting with 0
    // RED, GREEN, BLUE is the brightness 0..255 setpoint for that LED
    byte ExistingPort, WS2812pinHIGH;//local variables here to speed up pinWrites

    if(LED>=0){//map the REG GREEN BLUE Values into the RGB[] array
    RGB[LED * 3] = GREEN;
    RGB[LED * 3 + 1] = RED;
    RGB[LED * 3 + 2] = BLUE;
    }
    noInterrupts();//kill the interrupts while we send the bit stream out...
    ExistingPort = PORTB; // save the status of the entire PORT B - let's us write to the entire port without messing up the other pins on that port
    WS2812pinHIGH = PORTB | 1; //this gives us a byte we can use to set the whole PORTB with the WS2812 pin HIGH
    int bitStream = numberOfLEDs * 3;//total bytes in the LED string

    //This for loop runs through all of the bits (8 at a time) to set the WS2812 pin ON/OFF times
    for (int i = 0; i < bitStream; i++) {

    PORTB = WS2812pinHIGH;//bit 7 first, set the pin HIGH - it always goes high regardless of a 0/1

    //here's the tricky part, check if the bit in the byte is high/low then right that status to the pin
    // (RGB[i] & B10000000) will strip away the other bits in RGB[i], so here we'll be left with B10000000 or B00000000
    // then it's easy to check if the bit is high or low by AND'ing that with the bit mask ""&& B10000000)"" this gives 1 or 0
    // if it's a 1, we'll OR that with the Existing port, thus keeping the pin HIGH, if 0 the pin is written LOW
    PORTB = ((RGB[i] & B10000000) && B10000000) | ExistingPort;
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t");//these are NOPS - these let us delay clock cycles for more precise timing
    PORTB = ExistingPort;//okay, here we know we have to be LOW regardless of the 0/1 bit state
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t""nop\n\t""nop\n\t");//minimum LOW time for pin regardless of 0/1 bit state

    // then do it again for the next bit and so on... see the last bit though for a slight change

    PORTB = WS2812pinHIGH;//bit 6
    PORTB = ((RGB[i] & B01000000) && B01000000) | ExistingPort;
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t");
    PORTB = ExistingPort;
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t""nop\n\t""nop\n\t");

    PORTB = WS2812pinHIGH;//bit 5
    PORTB = ((RGB[i] & B00100000) && B00100000) | ExistingPort;
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t");
    PORTB = ExistingPort;
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t""nop\n\t""nop\n\t");

    PORTB = WS2812pinHIGH;//bit 4
    PORTB = ((RGB[i] & B00010000) && B00010000) | ExistingPort;
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t");
    PORTB = ExistingPort;
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t""nop\n\t""nop\n\t");

    PORTB = WS2812pinHIGH;//bit 3
    PORTB = ((RGB[i] & B00001000) && B00001000) | ExistingPort;
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t");
    PORTB = ExistingPort;
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t""nop\n\t""nop\n\t");

    PORTB = WS2812pinHIGH;//bit 2
    PORTB = ((RGB[i] & B00000100) && B00000100) | ExistingPort;
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t");
    PORTB = ExistingPort;
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t""nop\n\t""nop\n\t");

    PORTB = WS2812pinHIGH;//bit 1
    PORTB = ((RGB[i] & B00000010) && B00000010) | ExistingPort;
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t");
    PORTB = ExistingPort;
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t""nop\n\t""nop\n\t");

    PORTB = WS2812pinHIGH;//bit 0
    __asm__("nop\n\t");//on this last bit, the check is much faster, so had to add a NOP here
    PORTB = ((RGB[i] & B00000001) && B00000001) | ExistingPort;
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n \t");
    PORTB = ExistingPort;//note there are no NOPs after writing the pin LOW, this is because the FOR Loop uses clock cycles that we can use instead of the NOPS
    }//for loop


    interrupts();//enable the interrupts

    // all done!
    }

  6. #31
    Can you help me get glediator to work with ucs1903 ledstring a sketch that works ????

  7. #32
    Senior Member mortonkopf's Avatar
    Join Date
    Apr 2013
    Location
    London, uk
    Posts
    911
    unfortunately I have not been in a position to contribute to the forum for the last few months, and this is likely to continue. You can swap out the calls to the Leds using FastLED library, look in firstlight example and you will see the 1903 syntax.

  8. #33
    So the sketch you start this topuc with i can apply for my teensy 3,2 with glediator and ucs1903 ?
    Just swap the ucs1903 syntax as in firstlight from 2811 to ucs1903 ?

  9. #34
    #include <OctoWS2811.h> const int ledsPerStrip = 34; const int NUM_LEDS =272; DMAMEM int displayMemory[ledsPerStrip*6]; int drawingMemory[ledsPerStrip*6]; const int config = UCS1903_GRB | UCS1903_800kHz; OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config); void setup() { leds.begin(); leds.show(); } int serialGlediator() { while (!Serial.available()) {} return Serial.read(); } byte r,g,b; int i; void loop() { while (serialGlediator() != 1) {} for (i=0; i < NUM_LEDS; i++) { b = serialGlediator(); r = serialGlediator(); g = serialGlediator(); leds.setPixel(i, Color(r,g,b)); } leds.show(); } /* Helper functions */ // Create a 24 bit color value from R,G,B unsigned int Color(byte r, byte g, byte b) { //Take the lowest 8 bits of each value and append them end to end return( ((unsigned int)b & 0xFF )<<16 | ((unsigned int)r & 0xFF)<<8 | (unsigned int)g & 0xFF);}

    Gladiator is a pain, in that it seems to hang and crash on my Mac if you do things in the wrong order. First you need to set the matrix size, and then set the output parameters. Also, when setting th

  10. #35
    Quote Originally Posted by nikkilauda View Post
    #include <OctoWS2811.h> const int ledsPerStrip = 34; const int NUM_LEDS =272; DMAMEM int displayMemory[ledsPerStrip*6]; int drawingMemory[ledsPerStrip*6]; const int config = UCS1903_GRB | UCS1903_800kHz; Ucs1903 leds(ledsPerStrip, displayMemory, drawingMemory, config); void setup() { leds.begin(); leds.show(); } int serialGlediator() { while (!Serial.available()) {} return Serial.read(); } byte r,g,b; int i; void loop() { while (serialGlediator() != 1) {} for (i=0; i < NUM_LEDS; i++) { b = serialGlediator(); r = serialGlediator(); g = serialGlediator(); leds.setPixel(i, Color(r,g,b)); } leds.show(); } /* Helper functions */ // Create a 24 bit color value from R,G,B unsigned int Color(byte r, byte g, byte b) { //Take the lowest 8 bits of each value and append them end to end return( ((unsigned int)b & 0xFF )<<16 | ((unsigned int)r & 0xFF)<<8 | (unsigned int)g & 0xFF);}

    Like this ???
    What do i include instead of the octo2811 library .h ???

  11. #36
    Mortonkopf many many thanks it works !!!
    Yesss !!!! Thank you

  12. #37
    hello Mortonkopf,

    I tried everyhing create the Library/Java/Extensions folder included librxtxSerial.jnilib and RXTXcomm.jar files, but by starting up glediator i cant communicate with the computers ports.
    at com port there is nothing its stays blanc, serial open therefore i cant start.

    what am i doing wrong ?
    where can i let glediator find my com port ?

    i am sure the usb ports all work !!!

  13. #38
    hello Mortonkopf,



    I tried everyhing create the Library/Java/Extensions folder included librxtxSerial.jnilib and RXTXcomm.jar files, but by starting up glediator i cant communicate with the computers ports.
    at com port there is nothing its stays blanc, serial open therefore i cant start.

    what am i doing wrong ?
    where can i let glediator find my com port ?

    i am sure the usb ports all work !!!

  14. #39
    even on Jinx the same problem at com port there is none.
    so there is no communication and i have copied the two files tho the folder ?????

  15. #40
    Quote Originally Posted by PaulStoffregen View Post
    You need the RXTX files for your type of computer. You can't use the RXTX files made for a Mac on your Windows computer.

    You need to get copies the RXTX files that are built for Windows.
    cant get gladiator to connect whats the problem i cpoied the two files but no communication in gladiator

  16. #41
    Junior Member
    Join Date
    Aug 2016
    Posts
    1
    thanks to this forum... @PAUL and MORTONKOPF, thanks you for all your reply, able to run WS2812b strips using JINX with Glediator as protocol... cheers!!!

  17. #42
    Junior Member
    Join Date
    Dec 2016
    Posts
    1
    hi there if you are a mac user i have the same priblem and what i do its use the other librxtxserial.jnlilib i found this and work
    http://blog.brianhemeryck.me/install...mountain-lion/
    the link direct to other code is
    http://blog.iharder.net/wp-content/u...xSerial.jnilib

    cheers

  18. #43
    Junior Member
    Join Date
    Feb 2017
    Posts
    3
    Hi,

    Some people in this topic talk about limitation of 4000 by teensy.
    It's not possible to use multiple linked teensy with glediator / jinx ?
    A teensy 3.2 could drive approximativly 4000 leds but what is the limit of 3.6 ?

    Thx

  19. #44
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,787
    Teensy 3.6 should be able to do much, much more.

    However, all WS2812 take 30 us per LED. So as you use longer length strips, the update time grows. When the strips grow to 1100 (a total of 8800 LEDs), you're at the limit for achieving a smooth 30 Hz update rate. That's also a total of 792 kbytes/sec, which is approaching the 1.1 Mbyte/sec USB limit.

    Whether Glediator or Jinx can handle 8800 LEDs to a single device is a good question. If you try this, please take a moment to report what you learn?

  20. #45
    Junior Member
    Join Date
    Feb 2017
    Posts
    3
    Thank you Paul
    If I understand correctly, even if I chained several teensy via port video sync I would be limited by the transfer rate of the port com. (As I am a beginner, I prefer to ask for confirmation)
    Therefore, to exceed this limit, it is necessary to have software (or code) capable of sending the control signals in a "synchronized" manner to several ports com.
    Jynx can handle 48000 leds it seems to me but I do not know more. In any case it is possible to define a matrix of 48000 leds in the options.
    For now I am looking for a solution to drive 15000 leds via Jinx or not. But I will not hesitate to share my experience.

    Edit : I have just taken a look at the possibilities of Jinx and it is possible to associate one equipment per zone of a matrix of leds (in the manner of what is described in the doc on October WS2811: like this picture)
    Last edited by matthgyver; 02-22-2017 at 04:30 PM.

  21. #46
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,787
    Quote Originally Posted by matthgyver View Post
    If I understand correctly, even if I chained several teensy via port video sync I would be limited by the transfer rate of the port com.
    Well, this depends on specifically what is meant by "port com".

    If you use a Multi-TT USB 2.0 hub, or you have each Teensy plugged into its own Single-TT USB 2.0 hub, then your PC can transmit at 480 Mbit/sec and the hub(s) will convert to the 12 Mbit/sec speed Teensy uses. So it is possible from the USB point of view to stream more data.

    This all falls apart if you plug two Teensy into a cheap Single-TT hub. If using Single-TT hubs, you need a separate hub for each Teensy, with no other USB deviecs plugged into the hub.

    Whether Glediator can successfully send so much is a good question.

  22. #47
    Junior Member
    Join Date
    Feb 2017
    Posts
    3
    Ok thank's for the precision, I understand better

  23. #48
    Can someone please help me with what configurations I have to make to the Glediator code work considering I will have a matrix that is 80 x 20 pixels. Do I just need to change const int ledsPerStrip = 34; and const int NUM_LEDS = 272; to const int ledsPerStrip = 80; and const int NUM_LEDS = 1600; and also const int config = WS2811_GRB to const int config = WS2811_RGB - are they the only three changes I need to make and then just upload it to the teensy and it should receive data from Glediator (assuming I install it correctly)?

    The example code is inserted below for reference:

    Code:
    // Glediator example with OctoWS2811, by mortonkopf
    //
    // https://forum.pjrc.com/threads/33012-Gladiator-with-OctoWS2811-working-example
    
    #include <OctoWS2811.h>
    
    const int ledsPerStrip = 34;
    const int NUM_LEDS = 272;
    
    DMAMEM int displayMemory[ledsPerStrip*6];
    int drawingMemory[ledsPerStrip*6];
    
    const int config = WS2811_GRB | WS2811_800kHz;
    OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);
    
    void setup() {
      leds.begin();
      leds.show();
    }
    
    int serialGlediator() {
      while (!Serial.available()) {}
      return Serial.read();
    }
    
    void loop() {
      byte r,g,b;
      int i;
    
      while (serialGlediator() != 1) {}
    
      for (i=0; i < NUM_LEDS; i++) {
        b = serialGlediator();
        r = serialGlediator();
        g = serialGlediator();
    
        leds.setPixel(i, Color(r,g,b));
      }
      leds.show();
    }
    
    /* Helper functions */
    // Create a 24 bit color value from R,G,B
    unsigned int Color(byte r, byte g, byte b)
    {
      return (((unsigned int)b << 16) | ((unsigned int)r << 8) | (unsigned int)g);
    }
    Any assistance is appreciated. I have 1650 26mm 12v LEDs showing up this week and then have a following week to get the whole LED matrix built and working for a big event we run so I am somewhat desperate....

    Thanks in advance!

  24. #49
    Senior Member mortonkopf's Avatar
    Join Date
    Apr 2013
    Location
    London, uk
    Posts
    911
    yep, that should work, just change the leds per strip to your strip length, and then the numleds to your total led number. You will also need to set the parameters in Glediator.
    Last edited by mortonkopf; 07-17-2017 at 07:59 PM. Reason: typo correction

  25. #50
    Junior Member beil's Avatar
    Join Date
    Oct 2017
    Location
    Brisbane Australia
    Posts
    2
    Hi all,

    I have a Teensy 3.6 + Octows2811 adapter connected to an RPi3 and running Glediator successfully on a 900 pixel installation. I have set up glediator to start on boot and that all works great... except I have to manually open the serial connection. I would ultimately like to run this completely in headless mode. Does anyone know any way to do this automatically at program startup?

    Any help would be greatly appreciated.

    Cheers from OZ

Posting Permissions

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