hey im trying the same thing on my printer, i managed to get it working with the marlin firmware provided in the post but i want to use the newest version of marlin do you guys know which section i need to change in the marlin_main.cpp? because the part that is supposed to be modified is not there

this is what is supposed to be modified:

static void engage_z_probe(int d = 100) { //lower z probe
digitalWrite(Z_PROBE_PIN, HIGH);
delay(d);
}