changed IRpin to an Int rather than using #define