I have a Photon with a si7021 using the ported Adafruit_Si7021 libraries the project also has the DIY Mall 0.96 I2C display. The si7021 displays on the display correctly. My questions are as follows.
I found a different library to use instead of using the Adafruit_Si7021 I used Particle_Si7021. The conversion is in the .cpp.
New Code:
#include "Particle_Si7021.h"
SI7021 sensor;
void setup() {
sensor.begin();
}
void loop() {
// temperature is an integer in hundredths
int temperature = sensor.getFahrenheitHundredths();
temperature = temperature / 100;
// humidity is an integer representing percent
int humidity = sensor.getHumidityPercent();
//Display Temp and Hum on OLED
display.print("Hum: "); display.println(humidity);
display.print("Tmp: "); display.println(temperature);
Particle.publish("Tempature", String(temperature) + " °F", 60, PRIVATE);
}
In the si7021 library, the return types for temperature and humidity are float, not int. Please try again with your variables declared and float type and see if that helps.