Troubleshooting
Switching Off
Started by joebataz on .
Sign in or create an account to join the conversation.
I have 5 sets of switches (16 in each set). They are all configured as radio buttons so within each set I can only have one switch on. BUT under certain circumstances I'd like to be able to turn off ALL the switches in a group.I've tried doing:
setattribute(ASwitches,'x',{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0});
setattribute(ASwitches,'x',{0});
ASwitches.x = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
ASwitches.x = 0;
ASwitches.x = {0};
ASwitches.x ={};
I've also done loops setting each switch off.
I always have one switch on in each group. There's got to be a way to do this, shouldn't there? With the latency I've been seeing lately with Lemur (and WHAT'S up with that????) I need to keep my code tight and small. Any ideas?
Thanks all,
Joe B
setattribute(ASwitches,'x',{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0});
setattribute(ASwitches,'x',{0});
ASwitches.x = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
ASwitches.x = 0;
ASwitches.x = {0};
ASwitches.x ={};
I've also done loops setting each switch off.
I always have one switch on in each group. There's got to be a way to do this, shouldn't there? With the latency I've been seeing lately with Lemur (and WHAT'S up with that????) I need to keep my code tight and small. Any ideas?
Thanks all,
Joe B
The only way I can think of achieving this is create a pad object with a script which turns off Radio mode, sets buttons to 0 and ten turns Radio mode back on. It may not be the most beautiful way, but Hey it works:D
I've attached an example.
RadioSwitch_Reset.jzml
I've attached an example.
RadioSwitch_Reset.jzml
Mr. Cobra's method works great for your setup.
Also you could use Pads instead of switches and create a custom expression and use multicolor/light to get the same 'radio' effect and have more control.
Also you could use Pads instead of switches and create a custom expression and use multicolor/light to get the same 'radio' effect and have more control.
I think that's the way I've done this as well. Needs only few lines of code and works like radio buttons. I've been away from Lemur for some months, I don't remember exactly.ndivuyo wrote: Also you could use Pads instead of switches and create a custom expression and use multicolor/light to get the same 'radio' effect and have more control.
x is an expression not an attribute! 
I dont get what the problem is......
I created a switches object....8 rows, 8 columns...
I set the switches to radio mode.
I then created a single Pad - inside the pad....
script execute on expression x, up arrow
Switches.x=0;
The pad switches OFF succesfully ALL the switches. I know for a fact that "radio" mode has never been "respected" by scripts.
I created a switches object....8 rows, 8 columns...
I set the switches to radio mode.
I then created a single Pad - inside the pad....
script execute on expression x, up arrow
Switches.x=0;
The pad switches OFF succesfully ALL the switches. I know for a fact that "radio" mode has never been "respected" by scripts.
Oh wow, you're right. Guess I should've tried it first..
No worries bro! I cant understand why it didnt work for the OP in the first place, as one of his codes "should" work.
ASwitches.x = 0;
ASwitches.x = 0;
I also think one or several options posted by Joe should work. Using 'custom' radio button behavior has the advantage that you get feedback from the software/plugin.