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}
}