Avatar for IllusionaryPersona

IllusionaryPersona

Member since Jul 2015 • Last active Oct 2015
  • 1 conversations
  • 2 comments

Most recent activity

  • in General
    Avatar for IllusionaryPersona

    Sorry for my late answer,
    I have tried all of the things you listed above and now I can set the BH1750 up correctly but if I try to use it, it still gives me an error, so i made a picture of my setup. Maybe you can find the problem with it.
    Heres the code:

    I2C1.setup({scl:B6, sda:B7});
    var bh=require("BH1750").connect(I2C1, 0);
    bh.start(2, 0);
    
    function lux() { 
      var luxx = bh.read();
      console.log("lux=", luxx);
    }
    
    setInterval(lux,1000);
    

    And here is the error message:

    Uncaught InternalError: Timeout on I2C Read BUSY
     at line 1 col 53
    ...is.i2c.readFrom(this.i2ca,2),a=(a[0]<­<8)+a[1];this.onetime&&...
                                   ^
    in function "read" called from line 2 col 22
      var luxx = bh.read();
                          ^
    in function called from system
    
  • in General
    Avatar for IllusionaryPersona

    Ive recently tried to add the the Light Sensor BH1750 to the Pico but it doesnt seem to work regardless of what I try. I had already done this with my normal Espruino and it worked there.
    Heres how I tried to set it up :

    I2C1.setup({scl:B6, sda:B7});
    var bh=require("BH1750").connect(I2C1, 0);
    

    And thats the error message I get:

    Uncaught InternalError: Timeout on I2C Write BUSY
     at line 1 col 45
    ...i2ca=b;this.i2c.writeTo(b,1);this.i2c­.writeTo(b,3);this.acti...
                                   ^
    in function "c" called from line 1 col 33
    {return b?new c(a,92):new c(a,35)}
                                     ^
    in function "connect" called from line 1 col 41
    var bh=require("BH1750").connect(I2C1, 0);
                                             ^
    

    I have no Idea what I did wrong, so im looking forward to a newbee friendly answer.

Actions