Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Issue with element turning off at wrong time

  1. #1
    Join Date
    Nov 2018
    Posts
    16
    Post Thanks / Like

    Default Issue with element turning off at wrong time

    Hello all,
    I am fairly new to this. I am using an Arduino Mega hooked up to x2 - 8 channel relays. Using a total of 16 plugs, and only running basic LED christmas lights.

    The issue I am having on a few sequences is that I will have (for example) Plug 3 will be on "set level" solid for a long period of time, however it will turn off when another plug is activated (also at set level). Any ideas?

    Here is the code I am using if it helps.
    HTML Code:
    #define MEGA_VIXEN
    //#define UNO_VIXEN
    
    #ifdef MEGA_VIXEN
      #define MAX_CHANNELS 48
      int channels[MAX_CHANNELS] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,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(57600); // set up Serial at 57600 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]);
    }

  2. #2
    Join Date
    Dec 2014
    Location
    Southern California
    Posts
    749
    Post Thanks / Like

    Default Re: Issue with element turning off at wrong time

    you do not have any synchronizing bits. the data can get 'lost'.
    you are using Analogwrite when you should probably be using Digitalwrite.

    you should try the sketch by Victor_PV found here - http://doityourselfchristmas.com/for...th-Random-mode
    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.

  3. #3
    Join Date
    Nov 2018
    Posts
    16
    Post Thanks / Like

    Default Re: Issue with element turning off at wrong time

    Quote Originally Posted by kev View Post
    you do not have any synchronizing bits. the data can get 'lost'.
    you are using Analogwrite when you should probably be using Digitalwrite.

    you should try the sketch by Victor_PV found here - http://doityourselfchristmas.com/for...th-Random-mode
    Thank you. I was looking at Victor's code. However I do not want my lights on random when Vixen sequences are done. I want the lights to stay off.

    Sent from my SM-G930T using Tapatalk

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

    Default Re: Issue with element turning off at wrong time

    Just remove the end of sequence detection and they will stay the way you leave them.


    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.

  5. #5
    Join Date
    Nov 2018
    Posts
    16
    Post Thanks / Like

    Default Re: Issue with element turning off at wrong time

    Sorry again as I am new. How do I do that?

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

    Default Re: Issue with element turning off at wrong time

    There has to be some code that is tracking when the the last data arrived and starts a timer. The loop must be checking to see if enough time has passed since the last data. Either remove the check or change the wait time to a few days (effectively turning it 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.

  7. #7
    Join Date
    Nov 2018
    Posts
    16
    Post Thanks / Like

    Default Re: Issue with element turning off at wrong time

    Quote Originally Posted by MartinMueller2003 View Post
    There has to be some code that is tracking when the the last data arrived and starts a timer. The loop must be checking to see if enough time has passed since the last data. Either remove the check or change the wait time to a few days (effectively turning it off).
    Thanks for the help. I put Victor's code on the arduino. My lights do not appear to be working with it. The random mode surely works, but not the actual vixen sequences. I changed the vixen speen to 57600 as well to match the code.

  8. #8
    Join Date
    Nov 2018
    Posts
    16
    Post Thanks / Like

    Default Re: Issue with element turning off at wrong time

    Quote Originally Posted by kev View Post
    you do not have any synchronizing bits. the data can get 'lost'.
    you are using Analogwrite when you should probably be using Digitalwrite.

    you should try the sketch by Victor_PV found here - http://doityourselfchristmas.com/for...th-Random-mode
    Should I be using digitalwrite without using any pixels or led strips. Just normal christmas light strands that are LED.

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

    Default Re: Issue with element turning off at wrong time

    If you are not dimming then digitalwrite works. Analogwrite is only for certain output line on the MEGA. Did you add a header to your vixen generic serial controller configuration when you tried Victors code? You need it to synchronize to the data. You need to put ~! In the header box.
    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
    Nov 2018
    Posts
    16
    Post Thanks / Like

    Default Re: Issue with element turning off at wrong time

    Quote Originally Posted by kev View Post
    If you are not dimming then digitalwrite works. Analogwrite is only for certain output line on the MEGA. Did you add a header to your vixen generic serial controller configuration when you tried Victors code? You need it to synchronize to the data. You need to put ~! In the header box.
    No i did not. I simply copied the code. I'm not sure how to make those changes.

    Sent from my SM-G930T using Tapatalk

Page 1 of 3 123 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
  •