GPIO control based on printer hotend temp?
Is there any way to monitor printer status info to switch GPIOs based on values? That is, can I check the temp of the extruder and when it goes down to say 40C, turn off a GPIO output? Thinking of my enclosure fans which are run off a power strip which has a relay to switch it on and off. Once a print finishes it will needs some time to continue to exhaust.
Also, can I control the state of a GPIO output with a GPIO input? That is I have two input pins. One would be a button press to set a GPIO pin to high, the other to set low. This way I can turn something on and off.
MK3s / My IKEA Lack enclosure
RE:
For the buttons you can simply put 2 gcode files (btn_x.gcode where x is the input) into the "macros" folder on the USB stick - one only contains the code for setting your output to high and the other contains setting your output to low (M262 + M264 - see here).
Regarding temperature I don't think this is possible as all control structures (if else ..) is evaluated in the slicer. But what you could do, is connect the output pin of a different micro-controller with temperature sensor to the input and then also call the gcode file for setting the output.
RE: GPIO control based on printer hotend temp?
There is a gcode to set the hotend temp and wait. This you can add to the end of print and after it the gpio gcode