Basic scripting hel...
 
Notifications
Clear all

Basic scripting help.

11 Posts
4 Users
0 Reactions
4,175 Views
Wayne J
Posts: 7789
(@wayne-j)
Illustrious Member
Joined: 20 years ago

Post one of your sequences and profile (if you use one). I will see if I can make something up.


Reply
Posts: 5
Topic starter
(@quadslayer)
Active Member
Joined: 13 years ago

Here you go.

The sequence is just a test because my file size was too big to attach.


Reply
Wayne J
Posts: 7789
(@wayne-j)
Illustrious Member
Joined: 20 years ago

Put this in a script project and compile it see if it works. You can play around with it make it what you want.
Be sure to add the output plugin(s) while compiling.

void Start() {    // The compiler will ignore anything after two forward slashes, like these comments.
    // I've placed comments in the code to try to explain what I'm doing.


    // Since some things we're controlling is made up of multiple channels,
    // we're going to build collections of channels to control, one for each
    // entity.
    ChannelCollection Windows;
    ChannelCollection Bushes;


    Windows = Channels(Top_window_1, Top_window_2, Mid_window_1, Mid_window_2,
                Mid_window_3, Bottom_window_1, Bottom_window_2);


    Bushes = Channels(Bush_1, Bush_2, Bush_3, Bush_4, Bush_5, Bush_6);



    // These are static, they will not change, so we will turn them on and
    // leave them.
    On(Roof, At(50));    // At 50%
    On(Garage, At(50));
    On(Tree, At(50));


    // This will repeat forever until it's stopped by the application.
    while(true) {
        // Ramp from 0-100% over the span of one second and wait for it to complete.
        Ramp(Windows, 0, 100, Over(1).Second, Wait);
        // Have the channels on at full intesity for 5 seconds and wait for it to complete.
        On(Windows, For(5).Seconds, Wait);
        // Fade from 100-0% over the span of one second and wait for it to complete.
        Ramp(Windows, 100, 0, Over(1).Second, Wait);


        Ramp(Bushes, 0, 100, Over(1).Second, Wait);
        On(Bushes, For(5).Seconds, Wait);
        Ramp(Bushes, 100, 0, Over(1).Second, Wait);


    }


}

Reply
Wayne J
Posts: 7789
(@wayne-j)
Illustrious Member
Joined: 20 years ago

There is an error in the code I just caught...

"Roof" needs to be "Roof_"

"Garage" needs to be "Garage_Door"

Sorry.

I just ran it here and it works just fine.


Reply
Posts: 5
Topic starter
(@quadslayer)
Active Member
Joined: 13 years ago

Thank you very much. The code worked great.

What the problem was is that when it would send data out through the output pluggin I did have it not set it up with a header and footer that would read "VIXEN_START" and "VIXEN_END". I needed to set it up with a header and footer because that is what the code on the arduino board would listen for. So after setting up that everything worked great.

Thank you again.

Btw, Your light setup looks great.


Reply
Page 2 / 3
Share: