Hi im new to 3d printing and want to put an auto bed leveling sensor on my printer. i was hoping some one could tell me what code i need to put into marlin and how.
thanks tim

i have the blue inductive sensor.

If you download the latest Marlin 1.1.9. Copy 2 files in example_configurations/Anet/A8 folder to root. Make modification of two variables below depending on the location of your sensor. Compile and upload it.

#define X_PROBE_OFFSET_FROM_EXTRUDER 25 // 0 for my tarantula. X offset: -left +right [of the nozzle]
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0 // 85 for my tarantula. Y offset: -front +behind [the nozzle]

Here is a good information about the auto leveling.

https://3dprint.wiki/reprap/anet/a8/improvement/autobedleveling

i’ve done that. and had it working with the normal y axis switch but when i put the inductive sensor on it and homed the sensor it would move to the corner (sensor wouldn’t be over the bed anymore) and then move down until it couldn’t move any further. another problem is that i put a piece of metal under it while it was homing to see if it was just the position that it was at. but no the sensor picked up the metal but the printer didn’t stop moving.

thanks tim

Make sure you have umcommented the following line to turn safe_homing on.
#define Z_SAFE_HOMING.

Does your sensor trigger(LED turn on) when you place a mental at the tip? If it does, use gcode M119 to verify it before you do anything.

sorry to be stupid but i dont know how to do that is uncommenting // i know no code what so ever and how do i use m119?

thanks tim

Remove // in front of “#define Z_SAFE_HOMING” in your configure.h file of Marlin firmware.

Connect to your board with the Repetier-Host program via USB, and issue “M119” command to verify your sensor.

didnt need to do the command it seems to be working!!
big thanks!