Can you set external triggers to toggle gcode?
-
I have a dynamic button on my Duet, for one example, when a print starts, it is configured for trigger6
trigger6 contains a command for pause
pause contains a command to reconfigure the button for trigger7
trigger7 contains a command for resume
resume contains a command to reconfigure the button for trigger6
etc etc
should be easy to do it for LED stuff
-
Actually that sounds reasonable.... Thanks
-
Ok having a problem...
At the end of my config file I have
M106 P1 S1 ;Turns lights full bright
M581 T2 E3 S0 ;Light switchtrigger2.g
M106 P1 S0.66 ;Turns lights 1/3down
M581 T3 E3 S0 ;preps next triggertrigger3.g
M106 P1 S0.33 ;Turns lights 2/3down
M581 T4 E3 S0 ;preps next triggertrigger4.g
M106 P1 S0.0 ;Turns lights off
M581 T5 E3 S0 ;preps next triggertrigger5.g
M106 P1 S1 ;Turns lights Full on
M581 T2 E3 S0 ;preps next triggerThe lights will cycle down once and back to full bright as the button is pressed. But trigger5, the prep next trigger doesnt seem to work.
So i press the button from fresh restart, turns down 1/3 press again turns down another 1/3 press once more turns off, press again and turns on full bright, but pressing again does nothing. The lights would briefly flash off but isnt cycling down again.
Am i missing something?
-
When you create a new trigger to do something different next time the button is pressed, you should cancel the old one unless you want both trigger files to be run.
-
@dc42 Oh how do you cancel the old one?
I had assuming the new trigger declaration would over write the old one... -
@mangy_dog said in Can you set external triggers to toggle gcode?:
@dc42 Oh how do you cancel the old one?
I had assuming the new trigger declaration would over write the old one...Read the documentation for M581 on the GCodes wiki page.
-
I have read the docs and maybe I'm blind I can't see anything about canceling the previous trigger?
-
use S-1 to disable a trigger file
-
Thanks
s-1 wasnt listed on the doku gcode wiki... the reprap gcode wiki did mention it but as a delete all triggers option...Anyway its sorted now thanks
-
@mangy_dog said in Can you set external triggers to toggle gcode?:
Thanks
s-1 wasnt listed on the doku gcode wiki... the reprap gcode wiki did mention it but as a delete all triggers option...Anyway its sorted now thanks
From the doku wiki:
Using S-1 with no X Y Z or E parameters sets the trigger back to ignoring all inputs.