• The code have at least one problem - bit fields for registers are not shown for module user (or I do not know how to use it). I do not know JS so I do not know how to correct the code. Could you help me?
    I think I can not write description in style of "Writing Modules" because I use own board with a few sensors and do not know about boards available to others. But. of course, I can write code example:

    var i2c=new I2C();
    i2c.setup({ sda:D12, scl:D13} );
    //var sensor = require("VCNL4200").connect(i2c,{address­:0x51}); //0x51 is default address so may be omitted
    var sensor = require("VCNL4200").connect(i2c);
    //sensor.Configure(); //It is possible to use it for some default mode, but it should be investigated what to set as default
    sensor.setProxiConf3MS(0x70,0x27); //0x27 to use INT pin as proximity signal, 0x7 to use INT as interrupt
    function log (){
          " Proximity: " + sensor.getProximity() +
          " Ambient: " + sensor.getAmbient() +
          " White: " + sensor.getWhite() +
          " Int: " + sensor.getInterruptFlags().toString(16))­;
    setInterval(log, 1000);

Avatar for SergeP @SergeP started