You are reading a single comment by @David1234321 and its replies. Click here to read the full conversation.
  • the address is OK
    I have check in some i2c scanner

    I think something is wrong with the flash memory
    because I have upload the code using the esperino IDE in chrome this time , selected RAM
    and it's working , it print me the data

    this is the code:

    I2C1.setup({scl:D25,sda:D26, bitrate: 60000});
    var mcp = require("MCP9808").connect(I2C1, 0b000);
    console.log("I2C Setup Finsih");
    
    
    function ReadTemp() { 
      
    setInterval (function()
                 {
      digitalWrite(LED1,0);
      var temperature = mcp.getTemperature();
      var TimeStemp = new Date().toString();
      console.log(TimeStemp + "  :  " + "Temperature: " + temperature + " C");
      setTimeout(function(){
      digitalWrite(LED1,1);
      },5000);} , 10000);}
    
    ReadTemp();
    

    I have used upload to RAM
    and it's working

    Mon Oct 12 2020 10:53:35 GMT+0300 : Temperature: 21.625 C Mon Oct 12
    2020 10:53:45 GMT+0300 : Temperature: 21.5625 C Mon Oct 12 2020
    10:53:55 GMT+0300 : Temperature: 21.5 C Mon Oct 12 2020 10:54:05
    GMT+0300 : Temperature: 21.5625 C Mon Oct 12 2020 10:54:15 GMT+0300
    : Temperature: 21.5625 C Mon Oct 12 2020 10:54:25 GMT+0300 :
    Temperature: 21.5625 C

    now I have enter save() , in order to make it work after reboor\power off - everything
    got stuck:
    can't write nothing in the console
    get no replay
    the led is off

    this is what I have in the console after "save()"

    >save()
    =undefined
    Compacting Flash...
    Calculating Size...
    Writing..
    Compressed 40000 bytes to 6792
    

    what to do now ? something went wrong ?

    Thanks ,

About