• unfortunately, it still doesn't want to play ball...

    The espruino BMP280 page has this configuration:

    Device Pin Espruino
    1 (GND) GND
    8 (VCore) 3.3
    3 (SDI) B9(I2C1 SDA)
    4 (SCK) B8(I2C1 SCL)
    2(CSB) 3.3
    5(SDO) GND
    6(Vio) 3.3

    I have SDA on D1 and SCL on D2
    I have SBO on D28 and CSB on D29

    Then in the code I put D28 to GND and D29 to 3.3v
    The I2C pins need to be pulled up, not sure if I am doing that correctly.

    The code on the BMP280 page requires the BME280 module, I changed that into BMP280, assuming that is a mistake.

    digitalWrite(D28,0);
    digitalWrite(D29,1);
    
    pinMode(D1, "input_pullup");
    pinMode(D2, "input_pullup");
    
    I2C1.setup({scl:D2,sda:D1});
    var bme = require("BMP280").connect(I2C1);
    console.log(bme.getData());
    

    When running I get this error, not being able to write to the address..

    > >
     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v93 Copyright 2016 G.Williams
    >Uncaught InternalError: I2C Write Error 33281
     at line 1 col 20
    a.writeTo(118,[b,e])
                       ^
    in function "write" called from line 1 col 43
    ...s.write=c;this.write(244,39);this.wri­te(245,160);this.readCo...
                                  ^
    in function "f" called from line 1 col 101
    ...(b,e){a.writeTo(118,[b,e])})
                                  ^
    in function "connect" called from line 1 col 41
    var bme = require("BMP280").connect(I2C1);
                                            ^
    Uncaught Error: Field or method "getData" does not already exist, and can't create it on undefined
     at line 1 col 16
    console.log(bme.getData());
                   ^
    =undefined
    > 
    
About

Avatar for user79451 @user79451 started