You are reading a single comment by @StuntMonkeh and its replies. Click here to read the full conversation.
  • Thats better!

    I2C1.setup({scl:B6,sda:B7});
    var rtcTime = '';
    
    function time() {
      I2C1.writeTo(0x68/* I2C slave address*/, 0/* register addr*/);
      var data = I2C1.readFrom(0x68, 3/* bytes */);
      var seconds = ("0"+data[0].toString(16)).substr(-2);
      var minutes = ("0"+data[1].toString(16)).substr(-2);
      var hours = ("0"+data[2].toString(16)).substr(-2);
      rtcTime = (hours+":"+minutes+":"+seconds);
      print(text,data);  
      print(text,rtcTime);
      return;
    }
    
    setInterval(time, 10000);
    
About

Avatar for StuntMonkeh @StuntMonkeh started