Jump to content
I2Cdevlib Forums

Fran Hdez

Members
  • Posts

    1
  • Joined

  • Last visited

Fran Hdez's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Dear Rusell, I could not understand either that same concern. I totally get your point, taking the -521 LSB as the offset and 35 (ÂșC) as the offset measurement conditions (as could checked in the datasheet screenshot provided below). However, adding that offset value instead of subtracting it and adding 35 results in an accurate reading value. Also consider that if you extend the temperature's measurement through the time, the board will self-heat. I noticed risings around 0.6 to 1 degree. Please, before slopping any opinion here, keep in mind that the readings were tested to be accurate (see the attached image, I know is cropped up it was the only way it fixed 500 kb with a decent resolution). Kind regards to the community, Fran Hdez. #include "MPU6050.h" #include "Wire.h" int16_t temp_raw; float temp; MPU6050 sensor; void setup() { Serial.begin(57600); Wire.begin(); sensor.initialize(); if (sensor.testConnection()) { Serial.println("Sensor attached successfully"); } else { Serial.println("Error at sensor attachment"); } } void loop() { // Screen showing the MPU temperature read (16-bit in 2's Complement format, interpreted by default as a negative number). temp_raw = sensor.getTemperature(); temp = float(temp_raw + 521)/340 + 35.0 Serial.println (temp); delay (100); }
×
×
  • Create New...