Avatar for Gustav

Gustav

Member since Nov 2017 • Last active Dec 2017
  • 1 conversations
  • 2 comments

Most recent activity

    • 5 comments
    • 117 views
  • in Puck.js
    Avatar for Gustav

    Ahh, that is the problem. 2.92V.
    Thanks for a quick answer. I have powered it on a IO pin (D1) ;)

    I really appreciate the hard work you put in to your company. Keeping the users both up to date and supported. Thanks again Gordon.

  • in Puck.js
    Avatar for Gustav

    Trying to read humidity and temp in a jar. Worked 20 minutes ago, but now all I get is:

    { "err": true, "checksumError": false,
      "raw": "",
      "temp": -1, "rh": -1 }
    Temp is -1 and RH is -1
    

    Any thoughts ?
    Sensor hookup: Gnd = Gnd , Vcc = D1, DATA = D2

    My code:

    setWatch (function(){
    digitalWrite(D1, 1);  
      var dht = require("http://www.espruino.com/modules­/DHT11.js").connect(D2);
      dht.read(function (a) {
      console.log(a);
        console.log("Temp is "+a.temp.toString()+" and RH is "+a.rh.toString());
    
        if (a.rh > 70) {
          digitalPulse(LED1, 1, [2000]);
        }
        if (a.rh >= 60 && a.rh <= 70) {
          digitalPulse(LED3, 1, [2000]);
        }
        if (a.rh < 60 && a.rh != -1) {
          digitalPulse(LED2, 1, [200, 100, 200, 100, 200, 100, 200, 100, 200]);
        }
         if (a.rh === -1) {
          digitalPulse(LED1, 1, [200, 100, 200, 100, 200, 100, 200, 100, 200]);
        }
    });
      setTimeout(function() {
      digitalWrite(D1, 0);
    }, 7000);
    }, BTN, { edge:"falling",repeat:true,debounce:50})­;
    
    
    
Actions