pyVCP Button to Float Output

More
2 years 3 days ago #313333 by Project_Hopeless
I have a rcPWM servo working with a GUI slider control.  I want two quick buttons, one OPEN, and one CLOSE.  How can I have a boolean button set a float value? 
Code:
<hbox>   <button>     <halpin>"opn"</halpin>     <text>"Open"</text>     <bd>3</bd>   </button> </hbox>
Code:
######## rcPWM Gripper Control setp hm2_[MESA](BOARD).0.rcpwmgen.rate 50 setp hm2_[MESA](BOARD).0.rcpwmgen.00.width 1 setp hm2_[MESA](BOARD).0.rcpwmgen.00.offset 1.0 setp hm2_[MESA](BOARD).0.rcpwmgen.00.scale 112 net PWMcmd  pyvcp.servo-f  hm2_[MESA](BOARD).0.rcpwmgen.00.width        #float ##### button net PWMcmd  pyvcp.opn  hm2_[MESA](BOARD).0.rcpwmgen.00.offset = 2     #float







 

Please Log in to join the conversation.

More
2 years 3 days ago #313343 by MaHa
Replied by MaHa on topic pyVCP Button to Float Output
Maybe this can be done with one momentary button, toggle component and mux2, toggle between 2 float values. You can setp mux2.N.in0 and mux2.N.in1 to the desired float value and control it with toggle.N.out to mux2.N.sel
 

Please Log in to join the conversation.

More
1 year 11 months ago #313682 by Project_Hopeless

Maybe this can be done with one momentary button, toggle component and mux2, toggle between 2 float values. You can setp mux2.N.in0 and mux2.N.in1 to the desired float value and control it with toggle.N.out to mux2.N.sel

 
That worked like a charm!

Please Log in to join the conversation.

Time to create page: 0.097 seconds
Powered by Kunena Forum