Closed labajo closed 6 years ago
Hi, firstly thanks for your job, it is awesome.
I have a question with the following example: https://github.com/sandeepmistry/arduino-BLEPeripheral/blob/master/examples/temp_sensor/temp_sensor.ino
The API to set a new temperature is tempCharacteristic.setValue(reading); where reading is a float, and the Characteristic is float too.
tempCharacteristic.setValue(reading);
The problem is I cannot understand how can I convert the value to the right measure.
I'm using LightBlue to get a Temperature of: 0x33331344 (HEX) and a Humidity of 0x66666644(HEX). How can get the real value with a tool?
I used this https://www.scadacore.com/tools/programming-calculators/online-hex-converter/ But I could not see anything.
Thanks a lot.
Sorry for the mistake. It is a Little Endian Float. In node js / node red, you could use the following code:
let a = new Buffer([0x85, 0xeb, 0xb7, 0x41]); let s = a.readFloatLE() ; s = 22.989999771118164;
Hi, firstly thanks for your job, it is awesome.
I have a question with the following example: https://github.com/sandeepmistry/arduino-BLEPeripheral/blob/master/examples/temp_sensor/temp_sensor.ino
The API to set a new temperature is
tempCharacteristic.setValue(reading);
where reading is a float, and the Characteristic is float too.The problem is I cannot understand how can I convert the value to the right measure.
I'm using LightBlue to get a Temperature of: 0x33331344 (HEX) and a Humidity of 0x66666644(HEX). How can get the real value with a tool?
I used this https://www.scadacore.com/tools/programming-calculators/online-hex-converter/ But I could not see anything.
Thanks a lot.