Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: How to put vixen sequence onto Arduino uno

  1. #11
    Join Date
    Dec 2012
    Location
    Hudson MA
    Posts
    3,712
    Post Thanks / Like

    Default Re: How to put vixen sequence onto Arduino uno

    There are a bunch of sketches you can use on the Arduino. I prefer the version that turns the Arduino into a Renard device (Renard does NOT imply separate channels, just look at the PX1). Many people like to use a "Generic Serial" based sketch. Either way, you end up with a serial link from the show player to your Arduino. The serial link will use either RS-232 (short distances 0-5M) or RS-485 (longer distances >5M). You can find sketches in various conversations here on the Forum. Many believe the "Generic Serial" is easier to use but then forget that there needs to be a sync mechanism between the Show Player and the Arduino. The Renard protocol has that built in and is rock solid. Generic Serial uses a "Header" sequence of characters you set (and compile in) to gain sync. It is easily lost so you have a higher chance of flicker using generic serial.


    2019 - Just moved into a new home (yet another change of plans). Will be dim but not dark. Too much to do at the new place to leave time for a show.
    https://www.youtube.com/channel/UCyX...ttrsZNARkUce0Q

  2. #12
    Join Date
    Jan 2018
    Posts
    15
    Post Thanks / Like

    Default Re: How to put vixen sequence onto Arduino uno

    Quote Originally Posted by MartinMueller2003 View Post
    There are a bunch of sketches you can use on the Arduino. I prefer the version that turns the Arduino into a Renard device (Renard does NOT imply separate channels, just look at the PX1). Many people like to use a "Generic Serial" based sketch. Either way, you end up with a serial link from the show player to your Arduino. The serial link will use either RS-232 (short distances 0-5M) or RS-485 (longer distances >5M). You can find sketches in various conversations here on the Forum. Many believe the "Generic Serial" is easier to use but then forget that there needs to be a sync mechanism between the Show Player and the Arduino. The Renard protocol has that built in and is rock solid. Generic Serial uses a "Header" sequence of characters you set (and compile in) to gain sync. It is easily lost so you have a higher chance of flicker using generic serial.
    Hi
    that's some good information and I will look into it further. I was just starting to try and incorporate some better displays into my light set up and using vixen and an Arduino seemed the simplest way. id used a simple T1000s controller last year but found the led edit software so basic and the displays lacked any real wow factor so wanted to step it up. creating sequences in vixen using a megatree seemed straight forward so it was just trying to work out how to get this sequence to work on the pixels while using the Arduino. lots to learn but it will be worth it as some of the displays ive seen are mind blowing.
    thanks
    Paul

  3. #13
    Join Date
    Jan 2018
    Posts
    15
    Post Thanks / Like

    Default Re: How to put vixen sequence onto Arduino uno

    hi
    thanks for the link it was very useful. the code in the file is totally different to the one she uses in her display. the one that her link gives you is listed below..
    maybe shes just updated it.
    thanks
    Paul

    #include <FastLED.h>

    // Sets the maximum number of LEDs that this code will handle to avoid running out of memory
    #define NUM_LEDS 300

    // Sets the pin which is used to connect to the LED pixel strip
    #define DATA_PIN 6

    CRGB leds[NUM_LEDS];


    void setup() {
    // Define the speed of the serial port
    Serial.begin(115200);
    }

    void loop() {
    // Set some counter / temporary storage variables
    int cnt;
    unsigned int num_leds;
    unsigned int d1, d2, d3;

    // Begin an endless loop to receive and process serial data
    for(;;) {
    // Set a counter to 0. This couter keeps track of the pixel colors received.
    cnt = 0;
    //Begin waiting for the header to be received on the serial bus
    //1st character
    while(!Serial.available());
    if(Serial.read() != '>') {
    continue;
    }
    //second character
    while(!Serial.available());
    if(Serial.read() != '>') {
    continue;
    }
    //get the first digit from the serial bus for the number of pixels to be used
    while(!Serial.available());
    d1 = Serial.read();
    //get the second digit from the serial bus for the number of pixels to be used
    while(!Serial.available());
    d2 = Serial.read();
    //get the third digit from the serial bus for the number of pixels to be used
    while(!Serial.available());
    d3 = Serial.read();
    //get the end of the header
    while(!Serial.available());
    if(Serial.read() != '<') {
    continue;
    }
    while(!Serial.available());
    if(Serial.read() != '<') {
    continue;
    }
    // calculate the number of pixels based on the characters provided in the header digits
    num_leds = (d1-'0')*100+(d2-'0')*10+(d3-'0');
    // ensure the number of pixels does not exceed the number allowed
    if(num_leds > NUM_LEDS) {
    continue;
    }
    // Let the FastLED library know how many pixels we will be addressing
    FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, num_leds);
    // Loop through each of the pixels and read the values for each color
    do {
    while(!Serial.available());
    leds[cnt].r = Serial.read();
    while(!Serial.available());
    leds[cnt].g = Serial.read();
    while(!Serial.available());
    leds[cnt++].b = Serial.read();
    }
    while(--num_leds);
    // Tell the FastLED Library it is time to update the strip of pixels
    FastLED.show();
    // WOO HOO... We are all done and are ready to start over again!
    }
    }

  4. #14
    Join Date
    Dec 2012
    Location
    Hudson MA
    Posts
    3,712
    Post Thanks / Like

    Default Re: How to put vixen sequence onto Arduino uno

    Yes I have seen this one around. It is ok. You just need to remember to set up the generic header on the show player so that you get a good sync between the player and the Arduino.

    In general, statements like this: "while(!Serial.available());" are a bad thing. But since this device is not doing anything else and the serial line runs 5x slower than the pixel output, you get away with it.


    2019 - Just moved into a new home (yet another change of plans). Will be dim but not dark. Too much to do at the new place to leave time for a show.
    https://www.youtube.com/channel/UCyX...ttrsZNARkUce0Q

  5. #15
    Join Date
    Jan 2018
    Posts
    15
    Post Thanks / Like

    Default Re: How to put vixen sequence onto Arduino uno

    Quote Originally Posted by MartinMueller2003 View Post
    Yes I have seen this one around. It is ok. You just need to remember to set up the generic header on the show player so that you get a good sync between the player and the Arduino.

    In general, statements like this: "while(!Serial.available());" are a bad thing. But since this device is not doing anything else and the serial line runs 5x slower than the pixel output, you get away with it.


    Ok so far I've managed to upload some examples which all work fine but no matter what version of the code I try to use the arduino will not run any Vixen 3 sequence. Does anyone have a copy of a code that works ?
    thanks

  6. #16
    Join Date
    Dec 2012
    Location
    Hudson MA
    Posts
    3,712
    Post Thanks / Like

    Default Re: How to put vixen sequence onto Arduino uno

    Please describe what you mean by "Does Not Run". Are you getting an indication from the Uno that it is getting valid data? Corrupted Data? Have you made sure the baudrate compiled into the code is the same baudrate you have configured on Vixen? Are you sure the USB to Serial adapter is working?

    In other words there are a lot of details that must be addressed. You need to tell us what you tried before anyone can give you additional avenues of exploration. Keep in mind that using a software development platform like the Uno is not plug-and-play. There is a lot of tweaking involved.


    2019 - Just moved into a new home (yet another change of plans). Will be dim but not dark. Too much to do at the new place to leave time for a show.
    https://www.youtube.com/channel/UCyX...ttrsZNARkUce0Q

  7. #17
    Join Date
    Jan 2018
    Posts
    15
    Post Thanks / Like

    Default Re: How to put vixen sequence onto Arduino uno

    thanks I've cracked it now the baudrate was different. somehow I missed changing it over. thanks for the help and great advice. I know im fairly new to all this and have a lot to learn so really appreciate the help along my journey. maybe one day I can get to the stage where I have display like one of yours.#
    thank all

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

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