One of the M codes in MARLIN as noted in the README is M42 which is described as enabling "Change pin status via gcode". However, there is nowhere that I can find which describes how to use M42. For example, if I wanted to toggle the status of digital line D30 (aka A1), would I use "M42 30", "M42 D30" or something similar? I am looking to control a fan connected to one of the spare lines on a MELZI (or Sanguinololu) board via an external MOSFET so that it comes on at the end of a print to cool down the heated bed. (Not a fan used to cool a PLA print down as it is being produced - ie, not an M106 / M107).
Thank you,
Alan
EDIT
I have just done some searching on the MARLIN.PDE / MARLIN.INO file and PINS.H.
I don't have anything like a full understanding of how the firmware works but it would be good to get opinions on the following from those who know more than me ....
The syntax for the M42 command is: M42 S(value to be written to pin) P (pin number) e.g. To set digital pin 30 high, you would use M42 S1 P30
The MARLIN firmware will not enable you to change the status / write values to any of the pins in use for things such as the heaters, thermistors, end stops etc. The command will let you send values other than 0 and 1 to any pins which can output analogue values. (0-255)
Is that about right?
Thank you,
Alan
EDIT
I have just done some searching on the MARLIN.PDE / MARLIN.INO file and PINS.H.
I don't have anything like a full understanding of how the firmware works but it would be good to get opinions on the following from those who know more than me ....
The syntax for the M42 command is: M42 S(value to be written to pin) P (pin number) e.g. To set digital pin 30 high, you would use M42 S1 P30
The MARLIN firmware will not enable you to change the status / write values to any of the pins in use for things such as the heaters, thermistors, end stops etc. The command will let you send values other than 0 and 1 to any pins which can output analogue values. (0-255)
Is that about right?