pyVCP Button to Float Output
- Project_Hopeless
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 200
- Thank you received: 10
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.
- MaHa
- Offline
- Platinum Member
Less
More
- Posts: 394
- Thank you received: 156
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
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 200
- Thank you received: 10
02 Nov 2024 23:24 #313682
by Project_Hopeless
Replied by Project_Hopeless on topic pyVCP Button to Float Output
That worked like a charm!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 or Create an account to join the conversation.
Time to create page: 0.063 seconds