Page 9 of 23 FirstFirst ... 789101119 ... LastLast
Results 81 to 90 of 230

Thread: Vixen 3 and Arduino

  1. #81
    Join Date
    Nov 2013
    Posts
    85
    Post Thanks / Like

    Default Re: Vixen 3 and Arduino

    @natale, don't apologise your sketch i found very sensible and easy to follow creating tabs like that so much more sense. At least if you know theres a problem with vixen you go to the vixen tab rather than running the risk of changing something else by mistake. Thank you again.

  2. #82
    Join Date
    Oct 2013
    Location
    Northern Kentucky
    Posts
    83
    Post Thanks / Like

    Default Re: Vixen 3 and Arduino

    I can post it, how do I post my sequence for someone to test it? O know how ronpatch on vixen 3 how do u do it on vixen 2. I would like to use vixen 3 just cause I like the sequencer better. I have made 2 of these controllers and one is a stand alone runway controller and my relays dire as fast as I want them. I'm lost on this one. I have even tried making a test sequence with just the wipe feature and my RX light goes with it but my relays do nothing
    2013- Arduino Mega with 16 Channels with the blinky blinky blinky
    Plans for 2014- 32 channels Renard, 16 channels arduino, 12 channel arduino stand alone runway

  3. #83
    Join Date
    Oct 2013
    Location
    Northern Kentucky
    Posts
    83
    Post Thanks / Like

    Default Re: Vixen 3 and Arduino

    ok i have got them working together but my last 4 channels wont fire i dont get it. grrrrrrrrrrrr. hey at least i have 8 channels lol. here is the sketch i am using.

    #include "Utils.h"
    #include "Constants.h"

    // specifically for the uno
    #include <avr/interrupt.h>

    // Configure outputs
    int chanDigital[] = {LED1, LED2, LED3, LED4, LED5, LED6, LED7, LED8, LED9, LED10, LED11, LED12};
    int incomingByte[13]; // size of the chanPWM array

    // The rest should work automagically.
    int chanDigitalCount = 12; // saves processing later
    int i = 0; // Loop counter

    //setup the pins/ inputs & outputs
    void setup(){
    //chanDigitalCount = sizeof(chanDigital);

    // specifically for the UNO
    sei();

    // initalize PWM Channels / Pins
    for (i=0; i < chanDigitalCount; i++){
    pinMode(chanDigital[i], OUTPUT);
    }

    //we cant define the buffer here
    testSequence();

    // use 9600 , None 8, 1 for UNO
    Serial.begin(57600); // set up Serial at 9600 bps
    }

    void loop()
    {

    if (Serial.available() >= chanDigitalCount+2) {
    int uno = Serial.read();
    if (uno == 126){

    int dos = Serial.read();
    if (dos == 33){

    for (int i=0; i<9; i++) {
    // read each byte
    incomingByte[i] = Serial.read();
    }

    //Serial.println("Data Read");
    //for (int i=0; i<8; i++) {
    // read each byte
    // Serial.print("Byte: ");Serial.println(incomingByte[i]);
    //}

    led(LED1, incomingByte[0]); // Write current values to LED pins
    led(LED2, incomingByte[1]); // Write current values to LED pins
    led(LED3, incomingByte[2]); // Write current values to LED pins
    led(LED4, incomingByte[3]); // Write current values to LED pins
    led(LED5, incomingByte[4]); // Write current values to LED pins
    led(LED6, incomingByte[5]); // Write current values to LED pins
    led(LED7, incomingByte[6]); // Write current values to LED pins
    led(LED8, incomingByte[7]); // Write current values to LED pins
    led(LED9, incomingByte[8]); // Write current values to LED pins
    led(LED10, incomingByte[9]); // Write current values to LED pins
    led(LED11, incomingByte[10]); // Write current values to LED pins
    led(LED12, incomingByte[11]); // Write current values to LED pins

    }
    }
    }
    }

    void led(int pin, int value){
    if (isValidPin(pin)) {
    if (value < 49){
    turnOff(pin);
    }
    else
    {
    turnOn(pin);
    }
    }
    else
    {
    // Serial.println("Invalid Pin");
    }
    }


    void testSequence(){

    for (i=0; i < chanDigitalCount; i++){
    turnOn(chanDigital[i], 100);
    turnOff(chanDigital[i], 0);
    }

    }
    am i doing omething wrong and yes i have patches and mapped in both versions of vixen. Thank you again for all of the help this is the best site for the diy'er
    2013- Arduino Mega with 16 Channels with the blinky blinky blinky
    Plans for 2014- 32 channels Renard, 16 channels arduino, 12 channel arduino stand alone runway

  4. #84
    Join Date
    Nov 2009
    Location
    Morrisburg, On, Canada
    Posts
    979
    Post Thanks / Like

    Default Re: Vixen 3 and Arduino

    Quote Originally Posted by Dont1982 View Post
    ok i have got them working together but my last 4 channels wont fire i dont get it. grrrrrrrrrrrr. hey at least i have 8 channels lol. here is the sketch i am using.
    Did you add the 4 channels to your utils.cpp file? natale only had 8 listed last I looked.

  5. #85
    Join Date
    Oct 2013
    Location
    Northern Kentucky
    Posts
    83
    Post Thanks / Like

    Default Re: Vixen 3 and Arduino

    yes i did here is what each of the files look like, during self test it fires fine. i have went into vixen 2 and vixen 3 deleted the chanel and remapped it and it still wont fire.
    Constants.cpp
    #include "Arduino.h"
    #include "Constants.h"

    const int CHANNELS[12] = {LED1,LED2,LED3,LED4,LED5,LED6,LED7,LED8,LED9,LED1 0,LED11,LED12};


    Constants.h
    // Pin definitions
    #include "Arduino.h"

    #define LED1 2
    #define LED2 3
    #define LED3 4
    #define LED4 5
    #define LED5 6
    #define LED6 7
    #define LED7 8
    #define LED8 9
    #define LED9 10
    #define LED10 11
    #define LED11 12
    #define LED12 13

    #define CHANNELS_LENGTH 12
    #define BASE 0

    #define DEBUG false



    Utils.pp
    #include "Utils.h"
    #include "pins_arduino.h"


    //#include "WProgram.h"
    #include "Arduino.h"

    bool isValidPin(int pin) {
    // do not put serial println here it takes too much time and disturbs switching
    if (pin == LED1 | pin == LED2 | pin == LED3 | pin == LED4 | pin == LED5 | pin == LED6 | pin == LED7 | pin == LED8 | pin == LED9 | pin == LED10 | pin == LED11 | pin == LED12){ return true; }
    else {
    // Serial.print("ERROR: Not a Valid Pin");
    return false;
    }
    }

    /* Turn a given pin off */
    void turnOn(int pin){ if (isValidPin(pin)) { digitalWrite(pin, LOW); } }
    /* Turn a given pin on */
    void turnOff(int pin){ if (isValidPin(pin)) { digitalWrite(pin, HIGH); } }

    /* Turn a given pin on then delay*/
    void turnOn(int pin, int dlay){ turnOn(pin); delay(dlay);}

    /* Turn a given pin off then delay*/
    void turnOff(int pin, int dlay){ turnOff(pin); delay(dlay);}




    Utils.h
    include "Constants.h"

    bool isValidPin(int pin);
    void turnOn(int pin);
    void turnOff(int pin);
    void error_P(const char *str);

    void turnOn(int pin, int dlay);
    void turnOff(int pin, int dlay);
    2013- Arduino Mega with 16 Channels with the blinky blinky blinky
    Plans for 2014- 32 channels Renard, 16 channels arduino, 12 channel arduino stand alone runway

  6. #86
    Join Date
    Oct 2013
    Posts
    46
    Post Thanks / Like

    Default Re: Vixen 3 and Arduino

    @Dont1982

    Ok. So here's what we know.

    You've verified that your connections from the Arduino to the relays is connected and grounded properly because the test sequence on startup lit up all the lights.
    You've verified that the serial monitor test worked and switched on all the lights so you are able to connect to the Arduino via the serial protocol and send it data.

    Here's how the read loop works.

    It waits until the bytes available is greater than or equal to the number of channels + the two bytes for the header. The header is important as it is used to mark the beginning of each data record.

    If we get 12 bytes coming in from the serial input, the first two bytes have to represent the header of ~! which is char 126 and 33. If neither one of those two bytes come in, none of the data will be processed. Once we get the ~! and the data for the 12 channels (12 bytes), it will process the record of data which contains the values for each of the 12 channels.

    So, what can be going wrong, here are some possibilities.

    1. The Arduino is not receiving the header. When you configure your controller, there is an option in the "Generic Serial Setup" under a section called "Packet Data".
    Validate that the checkbox for "Send Text Header" is checked off. Verify that in the text input box below that you have the ~! in there.

    2. Once you've saved your changes and return to the "Controllers Configuration" dialog, you should see "Generic Serial" in the list of controllers. Check that the checkbox next to it is checked off. I've found that sometimes when I change the configuration, it gets unchecked.

    3. I see in your sketch you have the baud rate set to 57600. Did you try with 9600 and did you verify that the baud rate in your controller configuration matches that baud rate.

    Get back to me with a response for each of these questions before we go any further because the next steps we take from there will be more complex.

    4. Double check that you have all 12 channels mapped. If the Arduino is not getting all the channels, It won't work either.

  7. #87
    Join Date
    Oct 2013
    Location
    Northern Kentucky
    Posts
    83
    Post Thanks / Like

    Default Re: Vixen 3 and Arduino

    Yes the baud rate tried at 9600 but was just trying others than the 9600 to see it that cleared it up. It does the same on vixen 2 and vixen3. Yrs the header is in on both version and generic serial is also. They are checked and in vixen 2's sequencer you can test channels. When I test them they all work except for the last 4 channels. I have pulgged the last 4 channels into a different relay board with same results just to see if maybe I had some bad relays. I have all channels mapped.
    2013- Arduino Mega with 16 Channels with the blinky blinky blinky
    Plans for 2014- 32 channels Renard, 16 channels arduino, 12 channel arduino stand alone runway

  8. #88
    Join Date
    Nov 2013
    Posts
    85
    Post Thanks / Like

    Default Re: Vixen 3 and Arduino

    You need to chAnge on the vixen page the part that says for (int i=0; i<9; i++) {
    change the 9 to 12 and the same on the line below thats what i got confused on.

  9. #89
    Join Date
    Oct 2013
    Location
    Northern Kentucky
    Posts
    83
    Post Thanks / Like

    Default Re: Vixen 3 and Arduino

    ah ha thank you very much again i appreciate all of evryone's help
    2013- Arduino Mega with 16 Channels with the blinky blinky blinky
    Plans for 2014- 32 channels Renard, 16 channels arduino, 12 channel arduino stand alone runway

  10. #90
    Join Date
    Nov 2013
    Posts
    5
    Post Thanks / Like

    Default Re: Vixen 3 and Arduino

    Have you ever had anything download to the UNO via USB? I had one heck of a time with USB drivers first time I used the Arduino IDE on my MacBook.

Page 9 of 23 FirstFirst ... 789101119 ... 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
  •