• Not had any time past week or so @Gordon, been away working. Hope to be home again next week and get back on it.

    The program and module code I posted as Gists above is my latest (links below). So if you want to take that and spend some time on it, you are more than welcome. My aim was to eventually replicate what Ian did with his Arduino example.

    I just recently got the "Humidity Most Accurate" working as well, so only "Pressure" and "Pressure More Accurate" needs fixing although they look OK comparing my code with Ian's, the data sheet from Bosch and Bosch's code, so suspect a rounding issue or similar.

    Current test prog is here
    Current module code is here

    Output currently looks like this:

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v77 Copyright 2015 G.Williams
    >echo(0);
    ChipID   : 96
    CtrlMeas : 36
    Measuring...
    .
    .
    .
    .
    Done !!!
    ----------------------------------------------------------
    Temperature                      : 21.9
    Humidity                         : 45.8583984375
    Pressure               (Suspect) : -126.86268593172
    ----------------------------------------------------------
    Pressure More Accurate (Suspect) : 85.15359374999
    ----------------------------------------------------------
    Temperature Most Accurate        : 21.90582997486
    Humidity Most Accurate           : 45.85865386029
    Pressure Most Accurate           : 1006.10934649366
    ----------------------------------------------------------
    {
      "i2c": {
        "_options": { "scl": B6, "sda": B7, "bitrate": 100000 }
       },
      "compParams": { "dig_T1": 28415, "dig_T2": 26397, "dig_T3": 50, "dig_P1": 37393,
        "dig_P2": -10875, "dig_P3": 3024, "dig_P4": 6654, "dig_P5": 13, "dig_P6": -7,
        "dig_P7": 9900, "dig_P8": -10230, "dig_P9": 4285, "dig_H1": 75, "dig_H2": 356,
        "dig_H3": 0, "dig_H4": 335, "dig_H5": 0, "dig_H6": 30 },
      "t_fine": 112157.84947130654, "adc_t": 524245, "adc_p": 336661, "adc_h": 29806 }
    ----------------------------------------------------------
    

    Cheers

    Ian

About

Avatar for IanWatkins @IanWatkins started