Additional hardware-button for coolant

More
1 year 1 week ago - 1 year 1 week ago #337135 by juergen-home
Slightly changed from my  gamepad pendant  forum.linuxcnc.org/47-hal-examples/57498...tion-selector-switch
Maybe this works.
Code:
#---------------------------------------------------------------------------------------------------------- # Activate coolant / mist #---------------------------------------------------------------------------------------------------------- # A single joypad button will start and stop the coolant. # coolant on-off with toggle2nist loadrt toggle names=tog_0   # Load N components for logical NOT operations addf tog_0 servo-thread loadrt toggle2nist names=tog2nist_0   # Load N components for logical NOT operations addf tog2nist_0 servo-thread # this toggle in front of toggle2nist is needed for regular toggle2nist.comp in 2.9.6 net net-joy-coolant-toggle tog_0.in  <= input.0.btn-base3 # here is the button net net-button-start tog2nist_0.in <= tog_0.out net net-coolant.is-on tog2nist_0.is-on <= halui.coolant.is-on net net-coolant-off tog2nist_0.off => halui.coolant.off net net-coolant-on tog2nist_0.on => halui.coolant.on #----------------------------------------------------------------------------------------------------------
Last edit: 1 year 1 week ago by juergen-home. Reason: mist --> coolant

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

More
1 year 6 days ago #337269 by TripleM
toogle2nist works perfectly, but I have to change the debouncetime in the componet. it will be more comfortable if the debounce-time is changed by a hal pin
Code:
loadrt toggle2nist names=toggle.coolant addf toggle.coolant    servo-thread net coolant_is_on toggle.coolant.is-on <= halui.flood.is-on net coolant_button toggle.coolant.in <= emcopanel.coolant net coolant_on toggle.coolant.on => halui.flood.on net coolant_off    toggle.coolant.off => halui.flood.off
Code:
component toggle2nist "toggle button to nist logic"; pin in bit in  "momentary button in"; pin in bit is_on "current state of device"; pin in unsigned debounce = 50 "debounce delay for 'in'-pin in cycles"; .... ....
    

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

Moderators: newbynobi, HansU
Time to create page: 0.048 seconds
Powered by Kunena Forum