You are reading a single comment by @Sestre and its replies. Click here to read the full conversation.
  • Hello,

    I'm not sure about how to read the OPT3001 sensor's data and i didn't find a lot of documentation. Here my code and the error i have on output.

    My code :

    var i2c = new I2C();
    var opt = require("OPT3001").connectI2C(i2c);
    // default adresse (0x44) and pins are ok, connection works
    var data =;

    Output :

    >new Uint8Array([84, 73])
    new Uint8Array([48, 1])
    >Uncaught TypeError: Expecting a number or something iterable, got undefined
     at line 1 col 14
    a.writeTo(e,c);c=a.readFrom(e,2);print(c­);return c[1]|c[0]<<...
    in function "r" called from line 1 col 17
    in function "read" called from line 1 col 21
    var data =;

    The module is right connected and seems ready (led on). Can someone help me ?


Avatar for Sestre @Sestre started