You are reading a single comment by @JumJum and its replies. Click here to read the full conversation.
  • Based on this article I tried to connect the accelerometer to my Espruino board. Wrote some lines and get an error
    INTERNAL ERROR: Timeout on I2C Write Transmit Mode 2
    INTERNAL ERROR: Timeout on I2C Write Transmit
    at line 2 col 33
    this.i2c.writeTo(id,reg | 0x80);

    ´´´
    function GY291(i2c,sda,scl){
    this.i2c = i2c;
    var id = 0x53>>1;
    this.i2c.setup({scl:scl,sda:sda});
    }
    GY291.prototype.write = function(reg,val){
    this.i2c.writeTo(this.id,[reg,val]);
    };
    GY291.prototype.read = function(reg,count){
    this.i2c.writeTo(id,reg | 0x80);
    return this.i2c.readFrom(id,count);
    };
    GY291.prototype.turnOn = function(){
    this.write(0x2d,0);
    this.write(0x2d,16);
    this.write(0x2d,8);
    };
    var a = new GY291(I2C2,B11,B10);
    setInterval(function(){
    var c = a.read(0x32,6);
    console.log(c);
    },2000);

    ´´´

About

Avatar for JumJum @JumJum started