added example code for ir sensor