Multiswitch

More
6 years 3 months ago #174099 by muntzieman
Multiswitch was created by muntzieman
Does anyone have a good example of using multiswitch? I'm trying to use one button to toggle through a jog scale of 0, 0.001, 0.01, 0.1 and I can't find a good example.

Please Log in to join the conversation.

More
6 years 3 months ago #174140 by rodw
Replied by rodw on topic Multiswitch

muntzieman wrote: Does anyone have a good example of using multiswitch? I'm trying to use one button to toggle through a jog scale of 0, 0.001, 0.01, 0.1 and I can't find a good example.


Try this. but its a binary switch
forum.linuxcnc.org/show-your-stuff/32029...build?start=20#85279

Please Log in to join the conversation.

More
6 years 3 months ago #174161 by muntzieman
Replied by muntzieman on topic Multiswitch
I appreciate the information but I don't think it will work for my application. I'm using an arduino micro to build a joypad pendant as I outline in this post.
forum.linuxcnc.org/show-your-stuff/39435...joypad-and-hal-input

I've moved quite far along with this project but still a way to go. I've added a LCD screen (python script), rotary encoder and button inputs. Its amazing what you can do with the arduino joystick library.

I was hoping the multiswitch component would allow me to toggle through a jog scale with one button. Right now I have to hold a axis button, a scale button and turn the encoder.

Is the multiswitch component not used or is there a better way to toggle multiple items?

Please Log in to join the conversation.

More
6 years 3 months ago #174190 by phillc54
Replied by phillc54 on topic Multiswitch
You could do something like:
Code:
loadrt multiswitch cfg=3 loadrt mux4 addf multiswitch.0 servo-thread addf mux4.0 servo-thread setp mux4.0.in0 0.001 setp mux4.0.in1 0.01 setp mux4.0.in2 0.1 net sel0 multiswitch.0.bit-01 => mux4.0.sel0 net sel1 multiswitch.0.bit-02 => mux4.0.sel1 net scale-button <your_button_pin> => multiswitch.0.up net scale-out mux4.0.out => <your_scale_input_pin>

Please Log in to join the conversation.

More
6 years 3 months ago #174215 by muntzieman
Replied by muntzieman on topic Multiswitch
This is the example I've been looking for. It worked perfectly, thank you.

Please Log in to join the conversation.

Time to create page: 0.143 seconds
Powered by Kunena Forum