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

Thread: Crazy Ligts, random colors

  1. #11
    Join Date
    Sep 2020
    Posts
    12
    Post Thanks / Like

    Default Re: Crazy Ligts, random colors

    thanks a lot, Mike.
    Also yesterday I found a code that maybe I can adapt but I had other commitments.
    Today after work I'll try to take a look.
    The code you proposed seems to me more understandable.
    I will let you know.

    Graziano

  2. #12
    Join Date
    Sep 2020
    Posts
    12
    Post Thanks / Like

    Default Re: Crazy Ligts, random colors

    by mistake i made two psot, i don't know how to delete this
    Last edited by gb70; 10-18-2020 at 08:26 AM.

  3. #13
    Join Date
    Sep 2020
    Posts
    12
    Post Thanks / Like

    Default Re: Crazy Ligts, random colors

    Hello guys

    I have tried and tried but still not there, even one arch at a time.
    I changed the code slightly too and i try to insert it in pieces so that you can tell me where i am wrong or i don't understand.
    Not having 10 wire, I test with 5 wire of 50 LEDs; then I'll just have to change the number of leds for wire.

    At the beginning of the code, I include the library, define the number of wires, the number of LEDs per wire, colors of LEDs, the arduino pins to use, the type of led, the baud rate, variable for garbage:
    Code:
    #include <FastLED.h> 
      
      #define NUM_STRIPS 5
      #define NUM_LEDS_STRIP 50
      #define NUM_LEDS NUM_LEDS_STRIP * NUM_STRIPS
      
      CRGB leds[NUM_LEDS_STRIP];
      
      #define LED_PIN1 4
      #define LED_PIN2 5
      #define LED_PIN3 6
      #define LED_PIN4 7
      #define LED_PIN5 8
      
      #define LED_TYPE WS2811 //type of LED
      
      #define BAUD_RATE 115200
      
      int bufferGarbage[1];

    in "void setup()"
    I put the Arduino pins in output motality and create arrays to tell where to start with the various wires:
    Code:
    Serial.begin(BAUD_RATE);
        pinMode(LED_PIN1, OUTPUT);
        pinMode(LED_PIN2, OUTPUT);
        pinMode(LED_PIN3, OUTPUT);
        pinMode(LED_PIN4, OUTPUT);
        pinMode(LED_PIN5, OUTPUT);
      
      FastLED.addLeds<LED_TYPE, LED_PIN1>(leds, 0, NUM_LEDS_STRIP);
      FastLED.addLeds<LED_TYPE, LED_PIN2>(leds, NUM_LEDS_STRIP, NUM_LEDS_STRIP);
      FastLED.addLeds<LED_TYPE, LED_PIN3>(leds, 2 * NUM_LEDS_STRIP, NUM_LEDS_STRIP);
      FastLED.addLeds<LED_TYPE, LED_PIN4>(leds, 3 * NUM_LEDS_STRIP, NUM_LEDS_STRIP);
      FastLED.addLeds<LED_TYPE, LED_PIN5>(leds, 4 * NUM_LEDS_STRIP, NUM_LEDS_STRIP);
    now my problem, i think, the "for" in "void loop()", i can't get it to work ... any help?
    Code:
    if (Serial.available() >= 0){
              bufferGarbage[0] = Serial.read();
          for (int i = 0; i < NUM_LEDS_STRIP; i++) {
              Serial.readBytes( ( char*)(&leds[i]), 3);
          }
          for (int i = 0; i < NUM_LEDS_STRIP; i++) {
               Serial.readBytes( ( char*)(&leds[i]), 3);
          }
          for (int i = 0; i < NUM_LEDS_STRIP; i++) {
               Serial.readBytes( ( char*)(&leds[i]), 3);
          }
          for (int i = 0; i < NUM_LEDS_STRIP; i++) {
               Serial.readBytes( ( char*)(&leds[i]), 3);
          }
          for (int i = 0; i < NUM_LEDS_STRIP; i++) {
               Serial.readBytes( ( char*)(&leds[i]), 3);
          }
    
          FastLED.show();

    Sorry and have patience with my inexperience.
    thank so much
    Graziano

  4. #14
    Join Date
    Dec 2012
    Location
    Newtown CT
    Posts
    4,484
    Post Thanks / Like

    Default Re: Crazy Ligts, random colors

    Your loop code does not have any code to sync to a header string in the serial stream. Until you add that, you are always going to have an issue. Your show player needs to send a specific string of bytes at the start of every frame. your controller needs to watch for those bytes to know it is at the start of the frame. Once you have the header you can start processing the rest of the data as intensity values.


    2020 Full sized show reworked for the new location. Only adding (famous last words) 13 RBLs that I finally got converted to using pixels
    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. Dim show (3000 pixels) had regular visits most nights.
    https://www.youtube.com/channel/UCyX...ttrsZNARkUce0Q

  5. #15
    Join Date
    Sep 2020
    Posts
    12
    Post Thanks / Like

    Default Re: Crazy Ligts, random colors

    Hi Martin,

    could you help me with the code to synchronize and send the bytes? I'm getting lost, I guess.

    thanks
    Graziano

  6. #16
    Join Date
    Dec 2012
    Location
    Newtown CT
    Posts
    4,484
    Post Thanks / Like

    Default Re: Crazy Ligts, random colors

    The link to the mechanical relay stuff is really what you need. All you need to do is add the fastled init and replace the OutputToLights function with your output function. Here is the link again.

    https://www.diychristmas.org/wiki/in...chanical_relay


    2020 Full sized show reworked for the new location. Only adding (famous last words) 13 RBLs that I finally got converted to using pixels
    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. Dim show (3000 pixels) had regular visits most nights.
    https://www.youtube.com/channel/UCyX...ttrsZNARkUce0Q

  7. #17
    Join Date
    Oct 2014
    Location
    Sauk City, WI USA
    Posts
    1,451
    Post Thanks / Like

    Default Re: Crazy Ligts, random colors

    This was just posted...It uses most of your code. It compiles but is untested. Let us know if it helps.

    https://www.diychristmas.org/wiki/in..._and_pixels_V1

  8. #18
    Join Date
    Sep 2020
    Posts
    12
    Post Thanks / Like

    Default Re: Crazy Ligts, random colors

    Thank you very much for your availability.
    Sorry for the delay but this period is intense.

    I did some tests:
    Default Re: Crazy Ligts, random colors
    This was just posted...It uses most of your code. It compiles but is untested. Let us know if it helps.

    https://www.diychristmas.org/wiki/in..._and_pixels_V1
    the code is working. As soon as it is loaded it carries out the LED test and communicates well with Vixen. 3

    Now I go on with other tests, information on RS485 extenders, I have to connect one each signal output of arduino (5 signals of arduino, 5 RS485), right?

    Graziano

  9. #19
    Join Date
    Oct 2014
    Location
    Sauk City, WI USA
    Posts
    1,451
    Post Thanks / Like

    Default Re: Crazy Ligts, random colors

    If you have lots of pixels to run, then best to run on different lines. But you can daisy chain or drop off the Rs485 assuming you can get enough data down the line. Then implement a start channel program.
    Since you are into diy... you could implement your own e1.31 bridge. get the data on ethernet, parse out the channel data for each output and blast it out to each arduino.

  10. #20
    Join Date
    Sep 2020
    Posts
    12
    Post Thanks / Like

    Default Re: Crazy Ligts, random colors

    thank you so much Mike.
    I am at the beginning of this experience and not knowing anything about electronics I learned a lot by reading on the forum.
    I accept all possible advice, I will do some research on how to put everything together.
    Most likely you will hear me again ... ahahaha
    Fortunately, I have over a year to think about the best.

    good day
    Graziano

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
  •