Added debugging to the _readPin and _writePin methods.