Page 1 of 1

Barometer in CC2650

Posted: 17:40, 18 Jun 2015
by goldbaer
Hi there,
since I am programming a Tablet based weather station I needed the Barometer values and was wondering why I was getting values like "0.98665" or something like that..

In the Texas Instruments Support Forum I found this answer:
https://e2e.ti.com/support/wireless_con ... 51#1526551

After commenting the code provided and adding two lines of Code, my Tests provides the same readout values as the iOs TI Sensor-Tag App.



Can someone confirm the changes?

Code: Select all


//changed in tisensortag-ble-cc2650.js
instance.getBarometerValues = function (data)
        {
            //var p = evothings.util.littleEndianToUint16(data, 2)

            // Extraction of pressure value, based on sfloatExp2ToDouble from
            // BLEUtility.m in Texas Instruments TI BLE SensorTag iOS app
            // source code.
            // TODO: Move to util.js
            //var mantissa = p & 0x0FFF
            //var exponent = p >> 12

            //magnitude = Math.pow(2, exponent)
            //output = (mantissa * magnitude)

            //var pInterpreted = output / 10000.0

            //CHANGES MADE HERE
            rawP = (data[5] << 16) + (data[4] << 8) +  data[3];
            pInterpreted = rawP / 100.0;

            return {pressure: pInterpreted}
        }
       

Re: Barometer in CC2650

Posted: 02:09, 09 Jul 2015
by ardiri
this looks correct.
will synchronise with the team and see if we can validate the changes and update our examples accordingly.

Re: Barometer in CC2650

Posted: 13:19, 09 Jul 2015
by micke
Thanks a lot for reporting! Opened an issue for this bug here: https://github.com/evothings/evothings- ... issues/161
Best regards, Mikael

Re: Barometer in CC2650

Posted: 19:43, 23 Sep 2015
by Barrett
Great! Thank you.