ErikZalm/Marlin — pull request #940 by drf5n (2014-05-29 16:02:39+00:00)
Title: Marlin_main.cpp: Add digital read functionality to 'M42 Pxx.'

Making M42 handle inputs may enable easy experiments with filament-out sensors, polling in the host software for pauses or other signals, multiple extruder gcode, probing experiments etc...

Might me part of an answer for:

* https://github.com/ErikZalm/Marlin/issues/679
* http://forums.reprap.org/read.php?146,361964
* http://forums.reprap.org/read.php?147,358956

Analog read isn't supported.