     int value;
     value = analogRead(pin);
     if (isnan(value)) {
-        return NULL
+        return -1;
     } else {
-        return value
+        return value;
     }
 }
 
 /* sensor r/w */
 void callback() {
     mq7Value = readMQ7();
-    if (mq7Value == NULL) {
+    if (mq7Value < 0) {
         Serial.println("Failed to read from MQ7");
     } else {
         Serial.print("MQ7: ");
         Serial.print(mq7Value);
     }
     mq2Value = readMQ2();
-    if (mq2Value == NULL) {
+    if (mq2Value < 0) {
         Serial.println("Failed to read from MQ2");
     } else {
         Serial.print("  MQ2: ");

    Serial.print("  HeatIdx: ");
    Serial.print(dht.computeHeatIndex(t, h, false));
    Serial.println();
}

void setup() {

    int value;
    value = analogRead(pin);
    if (isnan(value)) {
        return -1;
    } else {
        return value;
    }
