You are reading a single comment by @David1234321 and its replies. Click here to read the full conversation.
  • Hello ,
    I have bought the MCP9808 and connect it

    copy the code from here:

    I2C1.setup({scl:B6,sda:B7, bitrate: 60000});
    var mcp = require("MCP9808").connect(I2C1, 0b000); // 0b000 means A2 = A2 = A1 = GND 
    var temperature = mcp.getTemperature();
    console.log("Temperature: " + temperature + " C");
    

    but I get this error:

    in function called from system
    Uncaught Error: Cannot read property 'getTemperature' of undefined
     at line 10 col 22
    var temperature = mcp.getTemperature();
                         ^
    in function called from system
    Uncaught Error: Cannot read property 'getTemperature' of undefined
     at line 10 col 22
    var temperature = mcp.getTemperature()
    

    what is missing?
    do I need to download something?
    Thanks,

About