Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: More than one Arduino mega

  1. #1
    Join Date
    Feb 2017
    Location
    Wales
    Posts
    34
    Post Thanks / Like

    Default More than one Arduino mega

    Hi,

    I have exchanged a few posts and replies under the Arduino forum on using more than one Arduino under Vixen 2 but have yet to get this working.

    I have not been able to set up a sequence with 24 channels, two generic serial ports with 12 channels each.

    Does any Vixen 3 user know if this would work under Vixen 3 ?

    Many thanks,

    Mike

  2. #2
    Join Date
    Dec 2012
    Location
    Hudson MA
    Posts
    2,734
    Post Thanks / Like

    Default Re: More than one Arduino mega

    yes it will, but it should work under v2 as well.


    2018 - Moving and going to visit my Daughter in New Zealand. Most likely I will be dark or nearly dark, Some static stuff that is simple to put up.

  3. #3
    Join Date
    Dec 2014
    Location
    Southern California
    Posts
    665
    Post Thanks / Like

    Default Re: More than one Arduino mega

    I used 4 Arduino MEGAs with Vixen 3. Can you post the sketch that you are using? I don't remember seeing it in the other thread.
    Kevin

    2017 - Pi3 w/FPP controlling 8 ESPixelsticks driving 1250pixels and 3 Arduino MEGAS communicating with ESP-01s driving 96 channels
    2016 - 184 channels of Blinking/Flashing using 4 Arduino MEGAs and cheap home-made props.

  4. #4
    Join Date
    Feb 2017
    Location
    Wales
    Posts
    34
    Post Thanks / Like

    Default Re: More than one Arduino mega

    Hi Kevin,

    Shouldn't have to ask this but never done this before - how do I post the Arduino sketch and the Vixen2 sequence please ?

    Thanks,

    Mike

  5. #5
    Join Date
    Dec 2014
    Location
    Southern California
    Posts
    665
    Post Thanks / Like

    Default Re: More than one Arduino mega

    you can copy the sketch code from the Arduino programming environment and then paste it into this forum's reply box. There is a "Copy for Forum" menu selection under the EDIT choice. That should put it in the correct format that is preffered.
    Kevin

    2017 - Pi3 w/FPP controlling 8 ESPixelsticks driving 1250pixels and 3 Arduino MEGAS communicating with ESP-01s driving 96 channels
    2016 - 184 channels of Blinking/Flashing using 4 Arduino MEGAs and cheap home-made props.

  6. #6
    Join Date
    Feb 2017
    Location
    Wales
    Posts
    34
    Post Thanks / Like

    Default Re: More than one Arduino mega

    Here is the code I have used for the two Arduinos. I am no programmer so this was just downloaded and a few simple changes made to channel counts, etc.

    Code:
    // Output
    
    int Chan1 = 2; 
    int Chan2 = 3; 
    int Chan3 = 4; 
    int Chan4 = 5; 
    int Chan5 = 6; 
    int Chan6 = 7;
    int Chan7 = 8;
    int Chan8 = 9;
    int Chan9 = 10;
    int Chan10 = 11;
    int Chan11 = 12;
    int Chan12 = 13;
    
    
    int i = 0; // Loop counter
    
    int incomingByte[13]; // array to store the 13 values from the serial port
    
    //setup the pins/ inputs & outputs
    
    void setup()
    
    {
    
    Serial.begin(9600); // set up Serial at 9600 bps
    
    pinMode(Chan1, OUTPUT); // sets the pins as output
    pinMode(Chan2, OUTPUT);
    pinMode(Chan3, OUTPUT);
    pinMode(Chan4, OUTPUT);
    pinMode(Chan5, OUTPUT);
    pinMode(Chan6, OUTPUT);
    pinMode(Chan7, OUTPUT);
    pinMode(Chan8, OUTPUT);
    pinMode(Chan9, OUTPUT);
    pinMode(Chan10, OUTPUT);
    pinMode(Chan11, OUTPUT);
    pinMode(Chan12, OUTPUT);
    
    
    }
    
    void loop()
    
    { // 13 channels are coming in to the Arduino
    
    if (Serial.available() >= 12) {
    
    // read the oldest byte in the serial buffer:
    
    for (int i=0; i<13; i++) {
    
    // read each byte
    
    incomingByte[i] = Serial.read();
    
    }
    
    analogWrite(Chan1, incomingByte[0]); 
    analogWrite(Chan2, incomingByte[1]); 
    analogWrite(Chan3, incomingByte[2]); 
    analogWrite(Chan4, incomingByte[3]); 
    analogWrite(Chan5, incomingByte[4]);
    analogWrite(Chan6, incomingByte[5]);
    analogWrite(Chan7, incomingByte[6]); 
    analogWrite(Chan8, incomingByte[7]); 
    analogWrite(Chan9, incomingByte[8]); 
    analogWrite(Chan10, incomingByte[9]); 
    analogWrite(Chan11, incomingByte[10]);
    analogWrite(Chan12, incomingByte[11]);
    
    
    }
    
    }
    Just to recap the problem -

    If I run a Vixen 2 sequence with 12 channels both the Ardunios work perfectly. When I use a sequence with Channels set to 24 and two generic serial ports set to channels 1 - 12 and 13 - 24 the LEDs just flash rather than staying on for a couple of seconds each.

    How do I upload the Vixen sequence as I suspect the problem is with the sequence rather than the Arduino sketch.

    Thanks,

    Mike

  7. #7
    Join Date
    Feb 2017
    Location
    Wales
    Posts
    34
    Post Thanks / Like

    Default Re: More than one Arduino mega

    I think I have uploaded the V2 sequence onto the V2 sequence forum.

  8. #8
    Join Date
    Dec 2012
    Location
    Hudson MA
    Posts
    2,734
    Post Thanks / Like

    Default Re: More than one Arduino mega

    Your sketch has a serious flaw if you plan to us V3. You are not using any sort of header to maintain data sync. If you get any sort of a data error, you will be out of sync until you shut down vixen and restart vixen. Not sure if any of your current issues are being caused by this,. but it is a significant issue for reliable playback.

    You are using analog write. What type of devices are you controlling? To dim lights you need to use a PWM output. If dimming AC lights you also need a zero cross detection input.


    2018 - Moving and going to visit my Daughter in New Zealand. Most likely I will be dark or nearly dark, Some static stuff that is simple to put up.

  9. #9
    Join Date
    Dec 2014
    Location
    Southern California
    Posts
    665
    Post Thanks / Like

    Default Re: More than one Arduino mega

    Quote Originally Posted by Mike_Parks View Post
    ........

    If I run a Vixen 2 sequence with 12 channels both the Ardunios work perfectly. When I use a sequence with Channels set to 24 and two generic serial ports set to channels 1 - 12 and 13 - 24 the LEDs just flash rather than staying on for a couple of seconds each..........
    I think that you are confusing channel count in the arduino sketch vs channel count in Vixen. When you say that "Channels set to 24", where is that number set? In the arduino sketch? because the sketch needs to stay at 12. Then tere needs to be 2 controllers configured in Vixen with 12 channels each.

    If you want to call me, PM me.
    Kevin

    2017 - Pi3 w/FPP controlling 8 ESPixelsticks driving 1250pixels and 3 Arduino MEGAS communicating with ESP-01s driving 96 channels
    2016 - 184 channels of Blinking/Flashing using 4 Arduino MEGAs and cheap home-made props.

  10. #10
    Join Date
    Feb 2017
    Location
    Wales
    Posts
    34
    Post Thanks / Like

    Default Re: More than one Arduino mega

    Hi,

    The LED strings I am using have LEDs at alternate polarity. I am using the L298N H bridge to control the LEDs. Two outputs from the Arduino to toggle the H bridge outputs and a PWN channel to dim the LEDs.

    I don't think the problem is anything to do with data sync as it happens every time. I had this sketch running for several weeks last Christmas without a single hitch.

    I have the Channel count in the Vixen sequence set to 24 with two generic serial ports - one set to channels 1 - 12 and the other for channels 13 - 24. Both the Arduinos have the sketch with 12 channels.

    I don't really want to have to move the V3, I don't need the additional features for what I am doing. I only mentioned using V3 as I thought it might be a way of overcoming my problem.

    Mike

Page 1 of 2 12 LastLast

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
  •