Home › Forums › Forums › Technical Support for BerryIMU › Temperature Sensor
- This topic has 4 replies, 3 voices, and was last updated 6 years, 4 months ago by PEERIS.
- AuthorPosts
- May 18, 2016 at 12:26 pm #4912jingramParticipant
Hi
Have you guys has any success with reading the temperature from the LSM9DS0?
May 18, 2016 at 2:27 pm #4913Mark WilliamsKeymasterYes.
In C it would be;uint8_t block[2]; readBlock(0x80 | OUT_TEMP_L_XM, sizeof(block), block); temp = (int16_t)(block[0] | block[1] << 8); float temperature_c = (float)temp / 8.0 + 25; float temperature_f = temperature_c * 1.8 + 32;
Mark --OzzMaker.com --
May 19, 2016 at 8:04 am #4916jingramParticipantHi Mark
Thanks for this.
I got the / 8, but where did you find to add the base 25 deg C in the spec sheet.May 19, 2016 at 10:12 am #4917Mark WilliamsKeymasterWe have been told that this is a reference number to use when calculating temperature on the chip.
If you are using a BerryIMU, you can get the ambient temperature from the BMP180.
Mark --OzzMaker.com --
April 30, 2017 at 8:34 pm #6447PEERISParticipantHi,
I have no succeed to work with BMP180 with the python code. The output data are like :
”
Starting temperature conversion…
Starting pressure conversion…
Calculating temperature…
Calculating pressure…Temperature: 827 C
Pressure: -4386776 hPa
”My aim is to use barometer as an altitude sensor
Is there an explication of BMP180 code to use the sensors as an altimeter ?Thx
- AuthorPosts
- You must be logged in to reply to this topic.