Toggle output/fan using button/trigger?
vwegert last edited by
As far as I understand the documentation, it should be possible to connect a simple pushbutton to an unused endstop (E1 for example) and use M581 to have it execute a custom g-code file. I've got a constant current driver for some LED strips in my printer, and I would like to connect them to an unused fan output - they draw about 600 mA, so the current should not be a problem. I don't know how the LED driver would react to being fed PWM input voltage, but then, I don't have to try that... Anyway, I could use M42 to enable or disable the LED. The problem is - I would like to have a toggle button, and as far as I can see, that's not possible at the moment, right? I would have to use a NO/NC switch and trigger on the rising/falling edge to switch the lighting on and off - or is there a way to conditionally branch between two parts of the trigger file?
(Also, the documentation for M42 reads "See also M583.", but M583 isn't documented - probably a typo?)
@vwegert, you could use either a single switch and triggers on the rising and falling edges, or a toggle switch connected to 2 endstop inputs.
Conditional GCode is scheduled for implementation in RRF 2.03.
Thanks for pointing out the error in the M42 documentation. I've corrected it.