pyVCP Button to Float Output

  • Project_Hopeless
  • Project_Hopeless's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
27 Oct 2024 20:13 #313333 by Project_Hopeless
pyVCP Button to Float Output was created 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? 
<hbox>
  <button>
    <halpin>"opn"</halpin>
    <text>"Open"</text>
    <bd>3</bd>
  </button>
</hbox>
######## 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 or Create an account to join the conversation.

More
28 Oct 2024 01:14 #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
 
The following user(s) said Thank You: Project_Hopeless

Please Log in or Create an account to join the conversation.

  • Project_Hopeless
  • Project_Hopeless's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
02 Nov 2024 23:24 #313682 by Project_Hopeless
Replied by Project_Hopeless 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

 

That worked like a charm!

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum