Author Topic: Temperature Value Conversion Algorithm  (Read 3163 times)

EDelang

  • RFduino Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Temperature Value Conversion Algorithm
« on: March 13, 2014, 05:07:19 PM »
How to I convert the float value sent out by the RFduino_temperature(FAHRENHEIT/CELCIUS) function from the Temperature Sketch to display the temperature on my Android device?  I receive a 32 bit value of 00-00-A4-41.  Now how to I convert this to actual temperature?

mkay

  • RFduino Team
  • *****
  • Posts: 405
  • Karma: +15/-0
    • View Profile
Re: Temperature Value Conversion Algorithm
« Reply #1 on: March 17, 2014, 11:04:21 AM »
Hi Edelang, so from your value of 00-00-A4-41. Take the A4 which is 164.

164 / 8 = 20.5C
« Last Edit: August 20, 2014, 03:38:46 PM by mkay »

EDelang

  • RFduino Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Temperature Value Conversion Algorithm
« Reply #2 on: March 22, 2014, 12:00:52 PM »
Thanks for the information.  It works fine to 0 degrees C.  How do I convert for temperatures below 0C?

EDelang

  • RFduino Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Temperature Value Conversion Algorithm
« Reply #3 on: March 22, 2014, 01:40:37 PM »
Never Mind... Just remembered that that was the die temperature, not the case temperature.  Will never get that low.

landscape

  • RFduino Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Temperature Value Conversion Algorithm
« Reply #4 on: August 20, 2014, 10:25:10 AM »
Where is the answer?

igor.filippov

  • RFduino Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Temperature Value Conversion Algorithm
« Reply #5 on: March 10, 2015, 01:47:30 PM »
Hi Edelang, so from your value of 00-00-A4-41. Take the A4 which is 164.

164 / 8 = 20.5C

Hi, can you give any explanation why divide by 8? And what is "41" part?

tmsio

  • RFduino Jr. Member
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: Temperature Value Conversion Algorithm
« Reply #6 on: December 13, 2015, 11:40:23 AM »
Try this....

(BluetoothLeService.ACTION_DATA_AVAILABLE.equals(action)) {
               
                byte[] data = intent.getByteArrayExtra(BluetoothLeService.EXTRA_DATA);
                float Sensor1 = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN).getFloat();
                temp_C.setText(Integer.toString((int) Sensor1 ) + "C");


This code work fine whit 1 value. Someone can help me to show two float value sent by rfduino?
« Last Edit: December 13, 2015, 11:43:48 AM by tmsio »

 

anything