New Homepage Forums Sensor Shields Why is pressure a long int?

This topic contains 2 replies, has 2 voices, and was last updated by avatar lids3qy 1 year, 8 months ago. This post has been viewed 503 times

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #40045
    avatarlids3qy
    Participant

    On my phone (Samsung Galaxy S7), the Android app displays the pressure in up to 5 decimal places. But the Arduino library only offers long int. Why is that? In the conversion, it only makes a difference of about .03 inHg per hPa but I’m still curious why.

    All the best,
    Barry

    #40088
    avatarAhmed ismail
    Keymaster

    Hi Barry, yeah actually, you have a point, we have just added it to our next release updates to change the Long into a Float.

    Thank you so much for this observation 🙂

    #121534
    avatarlids3qy
    Participant

    I looked at the Android code and it does convert pressure to a long int before sending it to the Arduino. I installed Android Studio, added the float value to the argument list and added code to the library to add a new function to the library called Pressure.getValueFloat() that retrieves the float value. It’s working great!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.