Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: Execute vixen sequence into arduino without vixen ?

  1. #11
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,278
    Post Thanks / Like

    Default Re: Execute vixen sequence into arduino without vixen ?

    Hi, have a look at this, it was written for an ESP8266 but in Arduino.
    http://doityourselfchristmas.com/for...s-a-FPP-remote

    Bill Porter put together a library to parse the .fseq file.
    https://github.com/madsci1016/ArduinoFSEQexample

    Feel free to ask any questions.

  2. #12
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,278
    Post Thanks / Like

    Default Re: Execute vixen sequence into arduino without vixen ?

    Hi, I got chance today to strip back the code linked above. The result runs on an ESP8266 Wemos Mini D1 with the SD shield.

    It compiles for the Arduino’s but I don’t have a SD shield for them so it’s untested.

    I’ve used the .fseq file type as both Vixen and xLights can export sequences in this format.

    I need to document this in a much better way but will have very little time this week so I’ve posted it in the hope it will get you going.

    Any questions please ask. I’ll most likely put up a new post once documented.

    Code:
    /*
      The following code is still under development by Barnabybear, use it in your show at your own risk..
    */
    
    #include <SPI.h>
    #include <SD.h>
    #include <FastLED.h>
    #include <ESP8266WiFi.h> // comment out if not using ESP8266
    
    // START OF USER SET UP INFOMATION
    
    #define NUM_LEDS 72 // the number of leds attached.
    #define DATA_PIN 2 // the pin used for data out.
    //const int chipSelect = 15;  // only needed if you don't use GPIO 15 as CS (Chip Select).
    
    //IMPORTANT - the file name needs to be in the format 8.3 chars.
    //When you save the file to the SD card give it an 8 char file name.
    //Edit the file name and remove the 'q' from .fseq to leave .fse
    
    const char FSEQ_Data_File[13] = "xxxxxxxx.fse"; // replace xxxxxxxx with your file name.
    long int First_Channel = 0;  // 0 = first channel number in .FSEQ file.
    bool Loop_Set = 1; // 0 = play once, 1 = loop.
    bool Debug = 1; // minimum debug.
    bool PSEQ_Headder_Debug = 1; // debug .PSEQ headder.
    // END OF USER SET UP INFOMATION
    
    long int Data_Offset;  // start of data in .FSEQ file (length of headder) (read from file).
    long int Number_Channels;  //  total number of channels in .FSEQ file (read from file).
    long int Step_Lenght;  // number of frames in .FSEQ file (read from file).
    int Frame_Time;  // FPS of of frames in .FSEQ file (read from file).
    unsigned long Time_Show = 0;
    unsigned long Time_Now;
    int Current_LED;  // variable for led looping.
    long int Current_Step;  // code current step / frame number.
    
    File dataFile;  // required by SD.h.
    CRGB leds[NUM_LEDS]; // required by FastLED.
    /////////////////////////////////////////////////////////
    
    void setup()
    {
      Serial_Initialize(); // Initialize serial.
      WiFi.mode(WIFI_OFF); // comment out if not using ESP8266
      FastLED_Initialize(); // Initialize FastLED.
      SD_Initialize(); // Initialize SD card.
      FESQ_Headder_Read();
    }
    /////////////////////////////////////////////////////////
    
    void loop()
    {
      if (dataFile) { // check file open.
        while (Current_Step < (Step_Lenght + 1)) { // if NOT at the end of the sequence.
          dataFile.seek(((Data_Offset) - 1) + First_Channel + ((Number_Channels) * Current_Step)); // first read postion = (after the file headder) + (miss out unused channels). Subcequent read postion = as above + (the number of channels in file * the number of previous reads).
          for (Current_LED = 0; Current_LED < NUM_LEDS; Current_LED++) { // loop based on number of channels / pixels to read
            leds[Current_LED].setRGB(dataFile.read(), dataFile.read(), dataFile.read()); // read 3 current pixel values into FastLED buffer.
          }
          while (!((millis() - Time_Show) > (Frame_Time))) {
            delay(1);
          }
          Time_Show = millis();
          FastLED.show();
          //      Serial.println(Current_Step); // debug print.
          Current_Step++; // add 1 to the current step postion.
          //      break;
        }
      }
      if (Loop_Set) {
        Current_Step = 0;
      }
    }
    /////////////////////////////////////////////////////////
    
    //*************** void Serial_Initialize ***************//
    void Serial_Initialize() {
      // Open serial communications and wait for port to open:
      Serial.begin(115200); // debug print.
      while (!Serial) {
        ; // wait for serial port to connect. Needed for Leonardo only.
      }
      Serial.println("Serial initialized @ 115200.");
    }
    /////////////////////////////////////////////////////////
    
    //*************** void FastLED_Initialize ***************//
    void FastLED_Initialize() {
      FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); // FastLED
      for (Current_LED = 0; Current_LED < NUM_LEDS; Current_LED++) {
        leds[Current_LED].setRGB(0, 0, 0);
        FastLED.show();
      }
      Serial.println("FastLED initialized & set to all off."); // debug print.
    }
    /////////////////////////////////////////////////////////
    
    //*************** void SD_Initialize ***************//
    void SD_Initialize() {
      Serial.print("Initializing SD card... "); // debug print.
      if (!SD.begin()) {  // see if the card is present and can be initialized.
        Serial.println("Card failed, or not present"); // debug print.
        return;
      }
      Serial.println("Card initialized."); // debug print.
    }
    /////////////////////////////////////////////////////////
    
    //*************** void FESQ_Headder_Read ***************//
    void FESQ_Headder_Read() {
      Serial.print("FSEQ file header details."); // debug print.
      dataFile = SD.open(FSEQ_Data_File); // open file.
      if (dataFile) { // check file open.
        //-----------------------------------------
        dataFile.seek(4); // set read pionter to correct byte.
        Data_Offset = (dataFile.read()); // read LSB.
        Data_Offset = Data_Offset + (dataFile.read() * 256); // read MSB & add to LSB.
        while (PSEQ_Headder_Debug) { // debug print.
          Serial.println(); // debug print.
          Serial.print("Data Offset: "); // debug print.
          Serial.print(Data_Offset); // debug print.
          Serial.print(" "); // debug print.
          break;
        }
        //-----------------------------------------
        dataFile.seek(10); // set read pionter to correct byte.
        Number_Channels = (dataFile.read()); // read LSB.
        Number_Channels = Number_Channels + (dataFile.read() * 256); // read MSB & add to LSB.
        while (PSEQ_Headder_Debug) { // debug print.
          Serial.println(); // debug print.
          Serial.print("Channels: "); // debug print.
          Serial.print(Number_Channels); // debug print.
          Serial.print(" "); // debug print.
          break;
        }
        //-----------------------------------------
        dataFile.seek(14); // set read pionter to correct byte.
        Step_Lenght = (dataFile.read()); // read LSB.
        Step_Lenght = Step_Lenght + (dataFile.read() * 256); // read MSB & add to LSB.
        while (PSEQ_Headder_Debug) { // debug print.
          Serial.println(); // debug print.
          Serial.print("Step Length: "); // debug print.
          Serial.print(Step_Lenght); // debug print.
          Serial.print(" "); // debug print.
          break;
        }
        //-----------------------------------------
        dataFile.seek(18); // set read pionter to correct byte.
        Frame_Time = (dataFile.read()); // Read FPS.
        while (PSEQ_Headder_Debug) { // debug print.
          Serial.println(); // debug print.
          Serial.print("Frame Timing: "); // debug print.
          Serial.print(Frame_Time, DEC); // debug print.
          Serial.println(); // debug print.
          break;
        }
        //-----------------------------------------
        while (Debug) { // debug print.
          Serial.print(FSEQ_Data_File); // debug print.
          Serial.println(" and variables set."); // debug print.
          delay(10);
          break;
        }
      }
      // if the file isn't open, pop up an error:
      else {
        while (Debug) { // debug print.
          Serial.print("error opening "); // debug print.
          Serial.println(FSEQ_Data_File); // debug print.
          break;
        }
      }
      return;
    }
    /////////////////////////////////////////////////////////

  3. Thanks kockie thanked for this post
  4. #13
    Join Date
    Nov 2015
    Location
    The Netherlands
    Posts
    53
    Post Thanks / Like

    Default Re: Execute vixen sequence into arduino without vixen ?

    I tried on an arduino uno with ethernetshield (because is has a sd-card slot on it). With some (little) tinkering I got it working! I just ordered a sd-shield for my esp/wemos.
    Errors for fun only.

  5. #14
    Join Date
    Dec 2011
    Location
    UK S80 postcode
    Posts
    1,278
    Post Thanks / Like

    Default Re: Execute vixen sequence into arduino without vixen ?

    Hi, good to know. Feel free to post the Uno code here, I'm sure it will help someone at some time.

  6. #15
    Join Date
    Nov 2015
    Location
    The Netherlands
    Posts
    53
    Post Thanks / Like

    Default Re: Execute vixen sequence into arduino without vixen ?

    It's the same code with some minor adjustments

    Code:
    /*
      The following code is still under development by Barnabybear, use it in your show at your own risk..
    */
    
    #include <SPI.h>
    #include <SD.h>
    #include <FastLED.h>
    //#include <ESP8266WiFi.h> // comment out if not using ESP8266
    
    // START OF USER SET UP INFOMATION
    
    #define NUM_LEDS 50 // the number of leds attached.
    #define DATA_PIN 2 // the pin used for data out.
    const int chipSelect = 4;  // only needed if you don't use GPIO 15 as CS (Chip Select).
    
    //IMPORTANT - the file name needs to be in the format 8.3 chars.
    //When you save the file to the SD card give it an 8 char file name.
    //Edit the file name and remove the 'q' from .fseq to leave .fse
    
    const char FSEQ_Data_File[13] = "12345678.fse"; // replace xxxxxxxx with your file name.
    long int First_Channel = 0;  // 0 = first channel number in .FSEQ file.
    bool Loop_Set = 1; // 0 = play once, 1 = loop.
    bool Debug = 1; // minimum debug.
    bool PSEQ_Headder_Debug = 1; // debug .PSEQ headder.
    // END OF USER SET UP INFOMATION
    
    long int Data_Offset;  // start of data in .FSEQ file (length of headder) (read from file).
    long int Number_Channels;  //  total number of channels in .FSEQ file (read from file).
    long int Step_Lenght;  // number of frames in .FSEQ file (read from file).
    int Frame_Time;  // FPS of of frames in .FSEQ file (read from file).
    unsigned long Time_Show = 0;
    unsigned long Time_Now;
    int Current_LED;  // variable for led looping.
    long int Current_Step;  // code current step / frame number.
    
    File dataFile;  // required by SD.h.
    CRGB leds[NUM_LEDS]; // required by FastLED.
    /////////////////////////////////////////////////////////
    
    void setup()
    {
      Serial_Initialize(); // Initialize serial.
    //  WiFi.mode(WIFI_OFF); // comment out if not using ESP8266
      FastLED_Initialize(); // Initialize FastLED.
      SD_Initialize(); // Initialize SD card.
      FESQ_Headder_Read();
    }
    /////////////////////////////////////////////////////////
    
    void loop()
    {
      if (dataFile) { // check file open.
        while (Current_Step < (Step_Lenght + 1)) { // if NOT at the end of the sequence.
          dataFile.seek(((Data_Offset) - 1) + First_Channel + ((Number_Channels) * Current_Step)); // first read postion = (after the file headder) + (miss out unused channels). Subcequent read postion = as above + (the number of channels in file * the number of previous reads).
          for (Current_LED = 0; Current_LED < NUM_LEDS; Current_LED++) { // loop based on number of channels / pixels to read
            leds[Current_LED].setRGB(dataFile.read(), dataFile.read(), dataFile.read()); // read 3 current pixel values into FastLED buffer.
          }
          while (!((millis() - Time_Show) > (Frame_Time))) {
            delay(1);
          }
          Time_Show = millis();
          FastLED.show();
          //      Serial.println(Current_Step); // debug print.
          Current_Step++; // add 1 to the current step postion.
          //      break;
        }
      }
      if (Loop_Set) {
        Current_Step = 0;
      }
    }
    /////////////////////////////////////////////////////////
    
    //*************** void Serial_Initialize ***************//
    void Serial_Initialize() {
      // Open serial communications and wait for port to open:
      Serial.begin(115200); // debug print.
      while (!Serial) {
        ; // wait for serial port to connect. Needed for Leonardo only.
      }
      Serial.println("Serial initialized @ 115200.");
    }
    /////////////////////////////////////////////////////////
    
    //*************** void FastLED_Initialize ***************//
    void FastLED_Initialize() {
      FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); // FastLED
      for (Current_LED = 0; Current_LED < NUM_LEDS; Current_LED++) {
        leds[Current_LED].setRGB(0, 0, 0);
        FastLED.show();
      }
      Serial.println("FastLED initialized & set to all off."); // debug print.
    }
    /////////////////////////////////////////////////////////
    
    //*************** void SD_Initialize ***************//
    void SD_Initialize() {
      Serial.print("Initializing SD card... "); // debug print.
      if (!SD.begin()) {  // see if the card is present and can be initialized.
        Serial.println("Card failed, or not present"); // debug print.
        return;
      }
      Serial.println("Card initialized."); // debug print.
    }
    /////////////////////////////////////////////////////////
    
    //*************** void FESQ_Headder_Read ***************//
    void FESQ_Headder_Read() {
      Serial.print("FSEQ file header details."); // debug print.
      dataFile = SD.open(FSEQ_Data_File); // open file.
      if (dataFile) { // check file open.
        //-----------------------------------------
        dataFile.seek(4); // set read pionter to correct byte.
        Data_Offset = (dataFile.read()); // read LSB.
        Data_Offset = Data_Offset + (dataFile.read() * 256); // read MSB & add to LSB.
        while (PSEQ_Headder_Debug) { // debug print.
          Serial.println(); // debug print.
          Serial.print("Data Offset: "); // debug print.
          Serial.print(Data_Offset); // debug print.
          Serial.print(" "); // debug print.
          break;
        }
        //-----------------------------------------
        dataFile.seek(10); // set read pionter to correct byte.
        Number_Channels = (dataFile.read()); // read LSB.
        Number_Channels = Number_Channels + (dataFile.read() * 256); // read MSB & add to LSB.
        while (PSEQ_Headder_Debug) { // debug print.
          Serial.println(); // debug print.
          Serial.print("Channels: "); // debug print.
          Serial.print(Number_Channels); // debug print.
          Serial.print(" "); // debug print.
          break;
        }
        //-----------------------------------------
        dataFile.seek(14); // set read pionter to correct byte.
        Step_Lenght = (dataFile.read()); // read LSB.
        Step_Lenght = Step_Lenght + (dataFile.read() * 256); // read MSB & add to LSB.
        while (PSEQ_Headder_Debug) { // debug print.
          Serial.println(); // debug print.
          Serial.print("Step Length: "); // debug print.
          Serial.print(Step_Lenght); // debug print.
          Serial.print(" "); // debug print.
          break;
        }
        //-----------------------------------------
        dataFile.seek(18); // set read pionter to correct byte.
        Frame_Time = (dataFile.read()); // Read FPS.
        while (PSEQ_Headder_Debug) { // debug print.
          Serial.println(); // debug print.
          Serial.print("Frame Timing: "); // debug print.
          Serial.print(Frame_Time, DEC); // debug print.
          Serial.println(); // debug print.
          break;
        }
        //-----------------------------------------
        while (Debug) { // debug print.
          Serial.print(FSEQ_Data_File); // debug print.
          Serial.println(" and variables set."); // debug print.
          delay(10);
          break;
        }
      }
      // if the file isn't open, pop up an error:
      else {
        while (Debug) { // debug print.
          Serial.print("error opening "); // debug print.
          Serial.println(FSEQ_Data_File); // debug print.
          break;
        }
      }
      return;
    }
    /////////////////////////////////////////////////////////
    Errors for fun only.

  7. #16
    Join Date
    May 2015
    Posts
    39
    Post Thanks / Like

    Default Re: Execute vixen sequence into arduino without vixen ?

    Quote Originally Posted by nono78 View Post
    Hello

    Is it possible to stock the result of the execution of the vixen template (the serial Flow by example). Charge it in the arduino sketch and play without vixen ?.

    Like it we dont need vixen online and have arduino totally autonomous

    Thank you for your help.

    Envoyé de mon F3211 en utilisant Tapatalk
    I use Vixen 3 sequences with a Raspberry Pi (for pixels) and an Arduino Mega with Ethernet shield for relay control. If you would like the Arduino sketch, let me know.

  8. #17
    Join Date
    Dec 2016
    Posts
    22
    Post Thanks / Like

    Default Re: Execute vixen sequence into arduino without vixen ?

    Quote Originally Posted by ssharpe83713 View Post
    I use Vixen 3 sequences with a Raspberry Pi (for pixels) and an Arduino Mega with Ethernet shield for relay control. If you would like the Arduino sketch, let me know.
    Hello. Yes if you can share the sketch i'm intéressé.

    Envoyé de mon F3211 en utilisant Tapatalk

  9. #18
    Join Date
    May 2015
    Posts
    39
    Post Thanks / Like

    Default Re: Execute vixen sequence into arduino without vixen ?

    Quote Originally Posted by nono78 View Post
    Hello. Yes if you can share the sketch i'm intéressé.

    Envoyé de mon F3211 en utilisant Tapatalk
    The sketch is pasted below:

    Code:
    /*
    Original code created January 4th, 2014 by Claude Heintz http://lx.claudeheintzdesign.com/lxarduino_sketches.html
    modified by: Jared Alexander
     
    This code is in the public domain.
    sACN E 1.31 is a public standard published by the PLASA technical standards program
    http://tsp.plasa.org/tsp/documents/published_docs.php
     
    Requires Arduino Ethernet Shield. Modifed to use the lastest version of Ethernet library included in Arduino 1.6.1. No need to install other libraries. 
    Receives E1.31 data (SACN) and ArtNet data for control of relays. This sketch is designed for use with SainSmart Relay boards.  
    You can only send the Arduino one protocol (E1.31 or ArtNet) at a time. 
    This sketch also includes a power on self test function to make sure everything is hooked up properly.
    */
    
    #include <SPI.h>    //Standard Library     
    #include <Ethernet.h> //Standard Library
    #include <EthernetUdp.h> //Standard Library
    
    
    /*  set the desired subnet and universe (first universe is 0)
        sACN starts with universe 1 so subtract 1 from sACN universe
        to get DMX_UNIVERSE.                                           */
    #define ARTNET_SUBNET 0 //defualt subnet is 0. Should not need to be changed. 
    #define ARTNET_UNIVERSE 0 //first universe being used
    #define E131_SUBNET 0 //defualt subnet is 0. Should not need to be changed. 
    #define ETHERNET_BUFFER_MAX 640
    #define ARTNET_ARTDMX 0x5000
    #define ARTNET_ARTPOLL 0x2000
    #define ARTNET_PORT 0x1936 //standard port
    #define ARTNET_START_ADDRESS 18 //Byte 18 in the packet contains channel 1 values.  
    #define E131_PORT 5568 //standard port 
    #define E131_START_ADDRESS 126 //Byte 126 in the packet contains channel 1 values. Offset is set to one prior. 
    #define STATUS_LED 13 //shows us when we are receiving data
    #define SDCARD_CONTROL 4 //set pin 4 to high to disable SD card interface on WiFi shield 
    #define NUM_RELAYS 24 //total number of relays used 
    
    int channel; //channel increment 
    
    //Relay Pins array
    int Relay[] = {22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45};
    
    //Timer Setup
    volatile byte currentcounter = 0; //counter for data reception
    byte previouscounter = 0; //counter for data reception 
    unsigned long currentDelay = 0; //current time value for ArtNet and E1.31 reception
    
    //Ethernet Configuration
    byte mac[] = {0x5a, 0x0a, 0x67, 0x94, 0x92, 0x94}; // random created unicast MAC
    IPAddress ip(192, 168, 1, 205);  //IP address of ethernet shield
    
    // buffer to hold E1.31 and Artnet data
    unsigned char packetBuffer[ETHERNET_BUFFER_MAX];
    
    // An EthernetUDP instance to let us send and receive packets over UDP
    // aUDP creates a socket for an Art-Net port
    // suUDP creates a socket for sACN that is unicast to the ip address
    EthernetUDP aUDP;
    EthernetUDP suUDP;
    
    void setup() 
    {
      pinMode(STATUS_LED, OUTPUT); //Initialize status LED
      pinMode(SDCARD_CONTROL, OUTPUT); //Initialize Pin 4
      digitalWrite(SDCARD_CONTROL, HIGH); //Set pin 4 to high since we are not using the SD Card interface
      for(int a = 0; a < NUM_RELAYS; a++) //loop to initialize relay control pins 
      {
       pinMode(Relay[a], OUTPUT); //initialize relay output pins
       digitalWrite(Relay[a], LOW); //set pins to low for off
      }
      Ethernet.begin(mac,ip);  //Initialize Ethernet shield 
      aUDP.begin(ARTNET_PORT); //Open Artnet Port
      suUDP.begin(E131_PORT); //Open E1.31 Port
      Serial.begin(9600); //Serial for debugging 
      POST(); //Run Power On Self Test Function
      Serial.println("Setup Complete"); //print complete 
    }
    
    /* artDMXReceived checks the universe and subnet then
       outputs the data to the relays */
    
    void artDMXReceived(unsigned char* pbuff) 
    {
      if ( (pbuff[14] & 0xF) == ARTNET_UNIVERSE ) 
      {
        if ( (pbuff[14] >> 8) == ARTNET_SUBNET ) 
        {
          channel = 0; //reset channel offset to 0 each time through loop
          //loop turns relay on/off based on channel value starting at Artnet start address
          for(int b = 0; b < NUM_RELAYS; b++) 
          {
           if(pbuff[ARTNET_START_ADDRESS + channel] > 127) //if channel value is greater then 127
          {
           digitalWrite(Relay[b], HIGH); //turn relay on 
          } 
          else
          {
           digitalWrite(Relay[b], LOW); //else turn it off 
          }
          channel++; //increase channel offset by 1 each time through for loop
          }
        }
      }
    } //end artDMXReceived 
    
    /*  artNetOpCode checks to see that the packet is actually Art-Net
        and returns the opcode telling what kind of Art-Net message it is.  */
    
    int artNetOpCode(unsigned char* pbuff) 
    {
      String test = String((char*)pbuff);
      if ( test.equals("Art-Net") ) 
      {
        if ( pbuff[11] >= 14 ) 
        {            //protocol version [10] hi byte [11] lo byte
          return pbuff[9] *256 + pbuff[8];  //opcode lo byte first
        }
      }
      return 0;
    }
    
    /* sacnDMXReceived checks the universe and subnet then
       outputs the data to relays  */
    
    void sacnDMXReceived(unsigned char* pbuff, int count) 
    {
        if ( pbuff[113] == E131_SUBNET ) 
      {  
          int addressOffset = 125; //first 125 bytes of packet are header information
          if ( pbuff[addressOffset] == 0 ) //start code must be 0
          {  
           channel = 0; //reset channel offset to 0 each time through loop
           //loop turns relay on/off based on channel value starting at E1.31 start address
          for(int c = 0; c < NUM_RELAYS; c++)
          {
           if(pbuff[E131_START_ADDRESS + channel] > 127) //if channel value is greater then 127
          {
           digitalWrite(Relay[c], HIGH); //turn relay on
          } 
          else
          {
           digitalWrite(Relay[c], LOW); //turn relay off 
          }
          channel++; //increment channel offset by 1
          }
          }
          } 
        } //end sacnDMXReceived 
        
      
    //checks to see if packet is E1.31 data
    int checkACNHeaders(unsigned char* messagein, int messagelength) 
    {
      if ( messagein[1] == 0x10 && messagein[4] == 0x41 && messagein[12] == 0x37) 
      {	
          int addresscount = messagein[123] * 256 + messagein[124]; // number of values plus start code
          return addresscount -1; //Return how many values are in the packet.
        }
      return 0;
    }
    
    /************************************************************************
      The main loop checks for and reads packets from the two UDP ethernet
      socket connections.  When a packet is recieved, it is checked to see if
      it is valid and then one of the DMXReceived functions is called, sending
      the DMX values to the output. There also is a timer to run a standby 
      program if no data is received for 30 seconds. 
    *************************************************************************/
    
    void loop() 
    {
      if(currentcounter != previouscounter) //has the value changed?
      {
        currentDelay = millis(); //store the time since the value has increased 
        previouscounter = currentcounter; //set the previous value equal to the current value
      }
      
      if(millis() - currentDelay > 30000) //is the time since the value changed greater than 30 seconds?
      { 
       digitalWrite(STATUS_LED, LOW); //turn LED off. Not receiving E1.31 or ArtNet. 
      }
      
      // first check to see if a packet is available on the Art-Net port
      int packetSize = aUDP.parsePacket();
      if( packetSize )
      {
        aUDP.read(packetBuffer, ETHERNET_BUFFER_MAX);
        /* after reading the packet into the buffer, check to make sure
           that it is an Art-Net packet and retrieve the opcode that
           tells what kind of message it is                         */
        int opcode = artNetOpCode(packetBuffer);
        if ( opcode == ARTNET_ARTDMX ) 
        {
          Serial.println("ArtNet Packet Received");
          artDMXReceived(packetBuffer);
          currentcounter++;  //increase counter by 1 each time through 
          digitalWrite(STATUS_LED, HIGH); //turn status LED on
        } 
      } 
        else 
        {
          /* then, if still no packet, check to see if a packet
             is available on the sACN unicastcast port         */
           packetSize = suUDP.parsePacket();
        if( packetSize ) 
        {
          suUDP.read(packetBuffer, ETHERNET_BUFFER_MAX);
          /* after reading the packet into the buffer, check to make sure
           that it is a valid sACN packet.*/
          int count = checkACNHeaders(packetBuffer, packetSize);
          if ( count ) 
          {
            Serial.println("E131 Packet Received");
            sacnDMXReceived(packetBuffer, count);
            currentcounter++;  //increase counter by 1 each time through 
          digitalWrite(STATUS_LED, HIGH); //turn status LED on
          }
        } 
        }
    } //End loop
    
    //Power on self test function to make sure everything is connected properly. 
    void POST()
    {
       for(int a = 0; a < NUM_RELAYS; a++) //loop to test relay control 
       {
         digitalWrite(Relay[a], HIGH);
         delay(1000);
         digitalWrite(Relay[a], LOW);
       }
       Serial.println("POST Complete");
    }

  10. #19
    Join Date
    Dec 2016
    Posts
    22
    Post Thanks / Like

    Default Re: Execute vixen sequence into arduino without vixen ?

    Thanks. i'll go to test

  11. #20
    Join Date
    Nov 2010
    Location
    Livermore, CA
    Posts
    2,122
    Post Thanks / Like

    Default Re: Execute vixen sequence into arduino without vixen ?

    Has anyone combined the sketches with one that can read the fseq and maybe the ESPixelstick code so that one could load a basic fseq file onto an ESPixelstick or similar and play it (on power on is fine). Seems there are lots of already done pieces but nothing combined. I don't know enough about this stuff to put it together.. I'll look more this eve but figured I would ask in this thread since folks are making some great progress.

    Basically the earlier mentioned fseq reader with this " http://doityourselfchristmas.com/forums/showthread.php?43254-Easy-testing-of-lights-amp-controllers-with-out-switching-on-your-PC&p=425666#post425666"

    Tory
    Happy to Show support;
    Xlights/Nutcracker and The Falcon Team

Page 2 of 3 FirstFirst 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
  •