AM2315 Not working

I’ve been trying unsuccessfully to get the Photon to read data from the AM2315 temperature sensor. My code is pretty simple.


This prints 2 every time so the sensor isn’t getting initialized properly. My wiring is ok. I have 10k pullup resistors on the SDA and SCL lines and I have verified the sensor works by reading data via a Raspberry Pi.

I tried running the code on the Arduino and it returned 4 instead of 2 but otherwise identical outcomes.

Any idea what I could do to get it working?

I had some issues with waking up the sensor. Not sure exactly what I did differently but kicking it a few times seems to have helped :astonished: