Page 4 of 4 FirstFirst ... 234
Results 31 to 40 of 40

Thread: Multiple Arduinos

  1. #31
    Join Date
    Nov 2009
    Location
    Morrisburg, On, Canada
    Posts
    2,521
    Post Thanks / Like

    Default Re: Multiple Arduinos

    Quote Originally Posted by Trepedor View Post
    --Relays are on when they should be off and off when they should be on...
    Most relays use "ground" to turn a relay on. Vixen use "high" to indicate ON.
    One trick is to invert the Vixen data. Try modifying (in red) the last line in your code;

    for (i = 0; i < MAX_CHANNELS; i ++ ) digitalWrite(channels[i], ~incomingByte[i]);

    This mod will also invert your INACTIVITY and POWER UP state - so it may need to be inverted too.
    Last edited by LightUp; 10-28-2017 at 10:02 AM.

  2. #32
    Join Date
    Oct 2017
    Posts
    2
    Post Thanks / Like

    Default Re: Multiple Arduinos

    Many thanks to MikeKrebs and LightUp. MikeKrebs got me thinking about my code and LightUp ultimately provided a solution that resulted in the exact action I want to achieve.
    This will make Halloween a lot of fun at our house. Can't wait to work on our new Christmas Light arrangement!

  3. #33
    Join Date
    Sep 2017
    Posts
    3
    Post Thanks / Like

    Default Re: Multiple Arduinos

    Hi,
    How can I make it so that all of the lights turn on after vixen or fpp send the Line "Show_Over" to the arduino, and that the arduino will begin receiving data when it receives a line from vixen or fpp that says "Show_Start"

  4. #34
    Join Date
    Dec 2017
    Posts
    5
    Post Thanks / Like

    Default Re: Multiple Arduinos

    Thank you all for you amazing guidance, insight, and CODE This year will be my first using my Arduino 2560MEGA and syncing lights to music, and I'm super excited! I think I have an issue. I purchased 4 SSR 8-channel relays in January, they came to me with "Low Level Trigger" on the board. I just ordered two more, from the same place using the same link, and they sent me "High Level Trigger". I have tried returning them to no avail. So, the question I have is: Do I need the code to have a specific section for the 32 channels that are using the Low Level Trigger relays (since I think low level triggers are on with no input) and a section for the 16 channels using the High Level Trigger (as they appear to be off with no input)? or are Low Level Trigger relays not-compatible with Vixen? (When I plug in the power to the relays, the 32 low level trigger relays light up and the 16 High level trigger relays do not. That is without powering up the Arduino. Any guidance would be greatly appreciated!

  5. #35
    Join Date
    Dec 2012
    Location
    Hudson MA
    Posts
    3,188
    Post Thanks / Like

    Default Re: Multiple Arduinos

    vixen knows nothing about this. you need to change the function that converts an intensity to an output state to output the proper value (high or LOW) based on the type of relay installed.

    The Arduino pins need to be configured as "output". This means the output is either high or low and it is up to you to define whether high == ON or high == off.


    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.

  6. #36
    Join Date
    Dec 2017
    Posts
    5
    Post Thanks / Like

    Default Re: Multiple Arduinos

    Thank you. I was hoping that I would be able to use these relays. I was trying to leverage the streamlined code from post #24 on page 3 of this thread, but I assume I can’t use that since it does not specify the pins as output, nor let me define each one as high == On or high == off. Do you happen to have some code I can use as a starting point? I saw the original posters code, but it is all analogwrite, and I want to use digitalwrite.

  7. #37
    Join Date
    Dec 2017
    Posts
    5
    Post Thanks / Like

    Default Re: Multiple Arduinos

    Thanks Martin! I see the code from the original poster, which specifies all the int and the pinMode, and then page two with the streamlined script, then page three with the streamlined script with the re-write for digitalWrite. Does anyone have some sample code which shows me where to put what? I think I need the void setup with all my channels specified at output, but not sure where I specify the High Low for each channel. Any suggestions?

  8. #38
    Join Date
    Nov 2016
    Posts
    7
    Post Thanks / Like

    Default Re: Multiple Arduinos

    Hi all, i have had four Uno's connected to vixen 2.1.1, when i run a sequence the first one seems strong and as it goes down the line its week? if i stop it and start another sequence nothing. any ideas please?

    windows XP
    vixen 2.1.1
    X4 uno
    X4 8 Channel relay

    I copy the code like the gentleman on you tube (cheep Skate) code below
    #define MEGA_VIXEN
    //#define UNO_VIXEN

    #ifdef MEGA_VIXEN
    #define MAX_CHANNELS 32
    int channels[MAX_CHANNELS] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,38,39,40, 41,42,43,44,45,46,47,48,49,50,51,52,53};
    #endif

    #ifdef UNO_VIXEN
    #define MAX_CHANNELS 18
    int channels[MAX_CHANNELS] = {2,3,4,5,6,7,8,9,10,11,12,13,A0,A1,A2,A3,A4,A5};
    #endif

    int incomingByte[MAX_CHANNELS];

    void setup()
    {
    int i;

    Serial.begin(9600); // set up Serial at 9600 bps

    for ( i = 0; i < MAX_CHANNELS; i ++ ) pinMode(channels[i], OUTPUT);
    }

    void loop()
    {
    int i;

    if (Serial.available() >= MAX_CHANNELS)
    {
    for (i=0; i < MAX_CHANNELS; i ++) incomingByte[i] = Serial.read();
    }

    for (i = 0; i < MAX_CHANNELS; i ++ ) analogWrite(channels[i], incomingByte[i]);
    }

  9. #39
    Join Date
    Dec 2017
    Posts
    5
    Post Thanks / Like

    Default Re: Multiple Arduinos

    Shaclayc, the first two lines of the code above is where you specifiy if you are using an Arduino Mega 2560 or Arduino Uno. Currently, the code is saying you are using the Arduino Mega “#define MEGA_VIXEN”. The two forward slashes “//“ tell the Arduino to ignore the code on that line. If you are using Arduino UNOs, you need to put the “//#define MEGA_VIXEN” and remove them from in front of the UNO line. See if that change will get you a bit further.

  10. #40
    Join Date
    Nov 2016
    Posts
    7
    Post Thanks / Like

    Default Re: Multiple Arduinos

    I will try that and let you now thanks


    Sent from my iPhone using Tapatalk

  11. Likes Technician37 liked this post
Page 4 of 4 FirstFirst ... 234

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
  •