QuoteI have a few Opto-endstops, "optical interrupter's" and would like to use them along with my mill to make a nice Encoder for a Lathe Spindle.I am not sure you can do this.Do you need to detect the motion in two directions or just one.One is easy you just count the number of pulses, maybe even with an interrupt.To what purpose do you want to put the count information you get?
I have a few Opto-endstops, "optical interrupter's" and would like to use them along with my mill to make a nice Encoder for a Lathe Spindle.
No need for a dxf file, it is just a disc with a hole in it.The sketch to is trivial, either use the standard interrupt count example or simply count the pulseIn the relevant part of the sketch.
You don't have to do anything to adjust the sketch for any size encoding disc, you are counting revolutions. You only need one hole in the disc, having more gives more pulses per revolution.I'm not sure what you are having difficulties with, you might be over thinking things.