Added analogue scaling & averaging; discrete check reads

Added input scaling function and averaging of multiple readings for
noise reduction to the analogue input node.
Added the ‘sanity check’ read of the digital input pin to the timer
callback in the discrete input node