Refactored read.c into functions

Added acknowledgement to others work
Not loving the MYPIN and NUMREADINGS defs