• PICO v1.88
    DHT22

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

    This gives:

    {
      "raw": "0100000001001000010000000011011001111110111",
      "rh": 28.9, "t": -21.7 }
    { "err": true,
      "raw": "0100000001001000110000000011011010111111"
     }
    { "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": "010000000100011110000000001101100111111000",
      "rh": 28.6, "t": 21.7 }
    {
      "raw": "010000000100011111000000001101101011111010",
      "rh": 28.7, "t": 21.8 }
    {
      "raw": "010000000100011110000000001101100111111000",
      "rh": 28.6, "t": 21.7 }
    
    
About