• OK, it's all working, sort of...

    Couple of the values coming back are suspect but I need to go through each function and check each one to ensure it's doing the right thing. I suspect it is just some rounding issues or other gotchas going from C to JS.

    Some output from my test rig:

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v76 Copyright 2015 G.Williams
    >echo(0);
    ChipID   : 96
    CtrlMeas : 36
    Measuring...
    .
    .
    .
    .
    Done !!!
    ----------------------------------------------------------
    {
      "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": 0, "adc_t": 525584, "adc_p": 335232, "adc_h": 30412 }
    ----------------------------------------------------------
    Temperature                      : 22.33
    Humidity                         : 49.2021484375
    Pressure               (Suspect) : -124.63193742510
    Pressure More Accurate (Suspect) : -116.96609374999
    Temperature Most Accurate        : 22.32728913521
    Humidity Most Accurate (Suspect) : NaN
    Pressure Most Accurate           : 1009.19167457070
    ----------------------------------------------------------
    

    Current test prog is here
    Current module code is here

    More when I've had time to work the functions and improve the code a bit. But still happy for anyone to chip in with improvement ideas.

    Cheers

    Ian

About

Avatar for IanWatkins @IanWatkins started