ErikZalm/Marlin — pull request #1037 by filipmu (2014-08-16 18:58:06+00:00)
Title: Support for a filament diameter sensor

This pull request supports the feature request in issue #1010 to provide an input for a real time filament diameter sensor that controls the volume of extrusion for one selected extruder. Implements a delay buffer to handle the transit delay between where the filament is measured and when it gets to the extruder. Gcode can be created once, and can be made independent of the filament diameter. See discussion for that issue.

For examples of these sensors, see: http://www.thingiverse.com/thing:89044, https://www.youmagine.com/designs/filament-diameter-sensor, http://diy3dprinting.blogspot.com/2014/01/diy-filament-diameter-sensor.html. Any sensor which produces a voltage equivalent to the diameter in mm (i.e. 1v = 1mm) can be used.

4 new Mcodes are defined to set relevant parameters.

Majority of this code (except for some code in the ISR) can be bypassed by undeclaring a #define. So it behaves nicely for the majority of users who don't have a sensor.

Pins defined for Rambo, Ramps 1.4, Printrboard.

I reverted a commit (1d0fe03 Change pinMode to SET_INPUT or SET_OUTPUT) since it was not really germane, but this is still an issue for printrboards and probably anything Teensylu.