UPDATE: I've uploaded a second config file. It's just occurred to me that I've edited both of these files AFTER I downloaded them from the online config tool. The first Configuration.h is for v0.92, the second is for v1.02 and is marked as such. I wouldn't recommend uploading these to the online config tool, the options at the very bottom don't line up with the actual configuration and might lead to some confusion. As always, be ready to power down your printer just in case.
UPDATE2: This is Repetier firmware.
UPDATE3: You may have to invert the direction of the X axis if you're using the stock mount.
If there are any questions, concerns or confusions feel free to message me and I'll try to clear it up and correct issues.
I've finally gotten tired of manual leveling so here's some firmware for a modified sunhokey kit printer. I'm not convinced this is the way to go still as I'm still having some issues with height. Those of you that have followed me for any amount of time, or for that matter, read any of my bed leveling posts, know that I think these sensors are far too inaccurate.
I'm using an 18 mm diameter NPN sensor ending in LJ18A3-8-ZBX marked as an 8 mm sense distance. The hot end mount found here.
The extruder gear is known as a 'MK8 Hobbed'. You will have to retune your e-steps after upload.
The sense line goes to Z min endstop marked S, the other wires are positive and negative which I've put on the 5V and ground of the mks gen off to the left side of the board. Further testing is required to determine accuracy.
Nonetheless, I'll make the firmware configuration.h available here. The main points to keep in mind are the starting script for the auto-level. Here I've got it starting with a G28 home all, then moving up to 10 mm (z move), then proceeding with a G29 S2 (probe three point, store avg. height).
My slicer has the starting gcode of "G29 S2;G28 X0 Y0;" without the quotes of course. This doesn't seem to be correct though. Still having issues with probe height calibration. Follow some fancy youtubers calibration procedure on this one.
NOTE: If your printer isn't configured like the picture, this probably won't work for you.
As with my other firmware upload, this is a config file, a starting point for you to reference and change to specific needs.