• PICO v1.88
    DHT22

    .....
      },6);
    }
    // Test with
    var dht = new HT("DHT22",B3);
    setInterval(function () {
    
    dht.read(print);
    },1000);
    
    

    This gives:

    {
      "raw": "010000000100100001000000001101100111111­0111",
      "rh": 28.9, "t": -21.7 }
    { "err": true,
      "raw": "010000000100100011000000001101101011111­1"
     }
    { "err": true,
      "raw": "01"
     }
    

    Change the 6 to 50

        } else {
          if (n>1) setTimeout(function() {ht.read(cb,--n);},500);
          else cb({err:true, raw:d});
        }
      },50);
    };
    

    This works and gives:

    {
      "raw": "010000000100011110000000001101100111111­000",
      "rh": 28.6, "t": 21.7 }
    {
      "raw": "010000000100011111000000001101101011111­010",
      "rh": 28.7, "t": 21.8 }
    {
      "raw": "010000000100011110000000001101100111111­000",
      "rh": 28.6, "t": 21.7 }
    
    
About