Hello, I'm building a machine as part of a project.

Hello,

I’m building a machine as part of a project.

Q: Is there any way Marlin supports a Gcode/Gcodes that can make a pin High and keep it at that state for a period of time specified.

My purpose is, I have made a machine, which runs on Marlin. What it does is, It has an impression making tool, that would make an impression on a powder, then another tool would come over this impression and dispense some liquid to it. I have a custom GUI to move machine to given coordinates, make impression, position Tool 2 over the impression. For dispensing liquid I’m thinking about buying diaphragm valve. I’ve downloaded user manual for it. As per documentation, when compressed air is given to valve it will lift diaphragm and will start dispensing. Amount of liquid dispensed depends on the how long air is given. So I’m thinking about using a relay to turn a solenoid valve ON and OFF to supply Air. To turn relay ON I need to make any GPIO pin HIGH. Is there any way I can make marlin do this.

http://marlinfw.org/docs/gcode/M042.html

Literally all I did was Google “Marlin Pin High” and it was the first result.

@ThantiK Thanks for the reply. I’m using RAMPS1.4. How can I know what are the free pins available. Shoud I define this pin somewhere in firmware?

@Athul_S_Nair The pins are marked on the Arduino Mega that you’re using.

Additionally you can use the ATMEGA2560 datasheet, the pins.h file, just use the fan output, heater output, etc.