Results 1 to 6 of 6

Thread: vixen 3 and arduino chasing with no program

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2018
    Posts
    7
    Post Thanks / Like

    Default vixen 3 and arduino chasing with no program

    hi im new here so i dont no if this post is right i tried to to use the ws2811 a 50 led string i connected it to my uno and installed a program to use vixen 3 it uses the fastled now when i open up vixen the leds start to chase just one at a time from end to end the vixen has no program set up yet so i set up vixen as instructed and did a basic bars now this runs ok but the single chaser is still running and i cant stop it. i also tried on a mega and another uno it still does this can anyone help please thankyou


    #include "FastLED.h"

    #define NUM_LEDS 22
    #define DATA_PIN 3

    #define CLOCK_PIN 13

    CRGB leds[NUM_LEDS];

    // BE CAREFUL w/DEBUG!
    // If you turn this on, do NOT expect a high refresh rate
    // w/out some bytes getting missed. The Serial library takes
    // a certain amount of time to output data, if too much data
    // is output too quickly, it may not allow time to read before
    // the UART buffer fills up. This can
    // be improved by commenting out DEBUG sections you don't need
    //boolean DEBUG = false;

    void setup() {

    // Uncomment/edit one of the following lines for your leds arrangement.
    // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
    FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS); // I changed RGB to GRB as that is how my pixels are configured
    // FastLED.addLeds<NEOPIXEL, DATA_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);

    FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
    //FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);


    Serial.begin(9600);

    }


    void loop() {


    for(int i = 0; i < NUM_LEDS; i++) {
    if (Serial.available() > 0) {
    Serial.readBytes( (char*)leds, NUM_LEDS * 3);

    }
    FastLED.show();
    }

    }

    nothing happens till i open vixen then it chases and i haven't started to program vixen
    i have tried other fastled sketches but none of them work this is the only one i can get to do anything
    thanks for any help

  2. #2
    Join Date
    Oct 2014
    Location
    Sauk City, WI USA
    Posts
    889
    Post Thanks / Like

    Default Re: vixen 3 and arduino chasing with no program

    The NUM_LEDS needs to match your element in Vixen. Does it?

    You have initialized FastLed with two different different protocols. Comment out the ws2801.

    I don't know why so many vixen/arduino sketches use 9600 bps. That is too slow for anything but a very small test. It takes 24 bits for one LED so one pass for 50 LEDS is 1200 bits. That gives only 8 fps - too slow for much animation. Bump this up to at least 57 and even 115. Be sure to change Vixen and Windows (if needed).

    Generally, arduino code using generic serial should use some kind of packet marker. You set this up in Vixen in the serial config "Send a text Header". In your sketch you need to check for this header before writing the data to the LED array. Otherwise, you will be lucky to get data that follows what you program in your sequence. In general it looks like this:
    int uno = Serial.read();
    if (uno == 126){

    int dos = Serial.read();
    if (dos == 33){
    ...read the serial bytes and load the array...
    }
    In this case the author is using ~! (126/33) as the text header.

    Change one thing at a time and see how it works. You will get there eventually.

  3. Likes mel liked this post
  4. #3
    Join Date
    May 2018
    Posts
    7
    Post Thanks / Like

    Default Re: vixen 3 and arduino chasing with no program

    ok i changed my pixels to 50 in arduino and vixen
    i commented out the ws2801
    im not good at programming but i put what you said in the arduino sketch
    #include "FastLED.h"

    #define NUM_LEDS 50
    #define DATA_PIN 3

    //#define CLOCK_PIN 13

    CRGB leds[NUM_LEDS];

    // BE CAREFUL w/DEBUG!
    // If you turn this on, do NOT expect a high refresh rate
    // w/out some bytes getting missed. The Serial library takes
    // a certain amount of time to output data, if too much data
    // is output too quickly, it may not allow time to read before
    // the UART buffer fills up. This can
    // be improved by commenting out DEBUG sections you don't need
    //boolean DEBUG = false;

    void setup() {
    int uno = Serial.read();
    if (uno == 126){

    int dos = Serial.read();
    if (dos == 33){
    // Uncomment/edit one of the following lines for your leds arrangement.
    // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
    FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS); // I changed RGB to GRB as that is how my pixels are configured
    // FastLED.addLeds<NEOPIXEL, DATA_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
    //FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);

    // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
    // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);

    }
    }
    Serial.begin(38400);

    }


    void loop() {


    for(int i = 0; i < NUM_LEDS; i++) {
    if (Serial.available() > 0) {
    Serial.readBytes( (char*)leds, NUM_LEDS * 3);

    }
    FastLED.show();
    }

    }

    now in the vixen tutorial it told me to put 0050 in the header is this correct thanks

    also without vixen as soon as i put my data pin into pin 3 my pixels start to chase and flicker thanks
    Last edited by mel; 05-16-2018 at 09:51 AM.

  5. #4
    Join Date
    May 2018
    Posts
    7
    Post Thanks / Like

    Default Re: vixen 3 and arduino chasing with no program

    well i tried all of that but still chase and flickers i think i might send for ws2812b to see if they work better thanks for your help

  6. #5
    Join Date
    May 2018
    Posts
    7
    Post Thanks / Like

    Default Re: vixen 3 and arduino chasing with no program

    looks like i found the problem my fastled lib was named fastLED 3.1.2 i just named it fastLED and it stopped chasing and flickering

  7. #6
    Join Date
    Oct 2014
    Location
    Sauk City, WI USA
    Posts
    889
    Post Thanks / Like

    Default Re: vixen 3 and arduino chasing with no program

    Glad to hear that worked for you. surprised the sketch could compile with the wrong name for the library. Good detective work!

  8. Likes mel liked this post

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
  •