Hello,
I am just experimenting and trying to add a new M code and a new sensor. I would like to be able to do various items in my new M code based on whether or not my sensor is triggered.
I am trying this;
case 444: //test new custom gcode BW
gcode_M444();break;
/**
* M444: new GCODE test
*/
inline void gcode_M444() {
//#if (READ(Z_MAX_PIN))
#if ENABLED(SDSUPPORT)
if(READ(Z_MAX_PIN) == 0)
{lcd_setstatus("LIQ LOW!!");}
else
{lcd_setstatus("LIQ HIGH!!");
}
#endif
So one of my first questions, I am not needing Z max endstop. So I want to hook a different sensor to zmax and this is what I want to check in my new code.
The code above works WHEN I have;
#define USE_ZMAX_PLUG
in my config file
If I take it out it gives compiles errors because it can't resolve Z_MAX_PIN
So because I have the above in my config (define use zmaxplug) will that cause marlin to think I am using z max endstop and break other things? If I comment out the define, then my code can no longer read my sensor from zmaxpin.
Thanks