Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long and or Short fade transition_time #7

Open
antonievonk opened this issue Jul 4, 2019 · 1 comment
Open

Long and or Short fade transition_time #7

antonievonk opened this issue Jul 4, 2019 · 1 comment

Comments

@antonievonk
Copy link

If the value_per_step is smaller then 0.5 it will never increase or decrease because of the Math.round function.
This creates a one step of change after the transition_time timeout.

maybe use the Math.round function in the sendDMX function instead of in the fadeToValue function.

Also this is in the way
if (diff <= steps) {
steps = 1;
}

@antonievonk
Copy link
Author

Changes I made:

        function sendDMX(values) {
            var DMXvalues = []
            for (var i = 0; i < values.length; i++) DMXvalues[i] = Math.round(values[i]);

            var post_data = querystring.stringify({
                u: node.universe,
                d: DMXvalues.join(',')
            });

//            if (diff <= steps) { // cannot be completed in the amount of steps, so reduce to just one step
//                steps = 1;
//            }
                    if (direction === true) {
                        var value = node.addresses[channel - 1] + value_per_step;
                    } else {
                        var value = node.addresses[channel - 1] - value_per_step;
                    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant