Made function to test the IR reading