trigger a macro with toolboard button
-
Hi,
I tried to trigger a macro when I click on one button of ToolBoard.
this is the Gcodes on my config file:; Input/Output M950 J1 P"!121.button0" M581 P1 T1 S1
and the macro named "trigger1.g":
;trigger1.g echo "button0" M300 S300 P200
Why this don't work ?
-
What actually happens?
I'm not sure that's how echo is intended to work.
https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands#Section_Echo_command
T1 would mean trigger1 which I believe means pause the print. I think you'd need to start at trigger2
https://duet3d.dozuki.com/Wiki/Gcode#Section_M581_RepRapFirmware_3_01RC2_and_later
Trigger number 0 causes an emergency stop as if M112 had been received. Trigger number 1 causes the print to be paused as if M25 had been received. Any trigger number # greater than 1 causes the macro file sys/trigger#.g to be executed. Polling for further trigger conditions is suspended until the trigger macro file has been completed. RepRapFirmware does not wait for all queued moves to be completed before executing the macro, so you may wish to use the M400 command at the start of your macro file. If several triggers are pending, the one with the lowest trigger number takes priority.
-
@Phaedrux It change to trigger5, to be sure. Still nothing happen, when i click the button.
I refer to this exemple: https://www.wildbot3d.xyz/control-panel/, but it is a bit old. -
Is there a way to read directly the value of a input ?
-
from https://duet3d.dozuki.com/Wiki/Duet_3_Tool_Board#Section_Buttons_and_LEDs
The buttons can be used to generate triggers in the normal way. Their pin names are "button0" and "button1". The required pullup resistors are enabled automatically on these pins.
So this is possible normally, but there are no doc to do it...
-
@Pseud3mys said in trigger a macro with toolboard button:
M950 J1 P"!121.button0"
The port name parameter in M950 is C, not P.
-
RESPONSE:
It is C parameter for the pin name, and trigger1 is already used.
the corrected code:; Input/Output M950 J1 C"!121.button0" M581 P1 T2 S1
AND the triggerX.g must be in /sys/ directory.
-
@pseud3mys said in trigger a macro with toolboard button:
Hi,
I tried to trigger a macro when I click on one button of ToolBoard.
this is the Gcodes on my config file:; Input/Output M950 J1 P"!121.button0" M581 P1 T1 S1
and the macro named "trigger1.g":
;trigger1.g echo "button0" M300 S300 P200
Why this don't work ?
Pseud3mys , please.
I'm trying to figure out what it would be like to connect the wires to the buttons on the board, using a 3 mini 5+ duet. Would you know how to recommend me?