nirenjan/libx52

support for setting multiple leds at once

Closed this issue · 1 comments

MNS26 commented

having the ability to set multiple led's at once would be a great feature (idk how else to put it)
example:

x52cli led A B D E I amber

EDIT: i found a workaround for my needs

function LEDcolor(){
    for(var i=0; i<arguments.length-1;i++)//dont loop over last one... thats the color
    {
    msg.payload= "led ".concat(arguments[i]," ",arguments[arguments.length-1])
    node.send(msg);
    }
}

im using node-red to read the game's status and depending on it change the led's... that code snippet just takes X variables as long as the last one is a state (on,off,red,amber,green)

The way x52cli is written, it is very rigid on the parameter processing. I would have to completely rewrite the program in order to implement this enhancement.