I2C connection randomly fails on P1 & Photon

@kennethlimcp,

Thanks for this. How can I use this with my code?