Grove barometer gives different results between Uno R3 and R4

After receiving a new Arduino R4 WiFi, one of the first tests I ran was to connect a Grove Barometer sensor to the SCL and SDA pins (and of course, power and ground). I then ran the Barometer demo V1.0. The R4 showed crazy high numbers for temperature (118.2 deg C) and pressure (3345 Pa, which equates to an altitude of 21,000 meters). I moved the sensor to an Uno R3 using the same pins and got correct temperature and pressure using the exact same barometer demo sketch. I am using the SCL and SDA pins rather than the Qwiic connector.

Do I need to initialize the I2C port somehow? I tried Wire.begin() but it didn't seem to matter. Any ideas?

please post your full code

Note that "Uno R4" is not a next release of the "Uno R3", it is a completely different controller. A code, developed for R3 uno, can be incompatible with R4

Here is the barometer code I'm using:

/* Barometer demo V1.0
*  Based largely on code by  Jim Lindblom
*  Get pressure, altitude, and temperature from the BMP085.
*  Serial.print it out at 9600 baud to serial monitor.
*
*  By:https://www.seeedstudio.com
*/
#include "Barometer.h"
#include <Wire.h>

float temperature;
float pressure;
float atm;
float altitude;
Barometer myBarometer;

void setup(){
    Serial.begin(9600);
    myBarometer.init();
}

void loop()
{
    temperature = myBarometer.bmp085GetTemperature(myBarometer.bmp085ReadUT()); //Get the temperature, bmp085ReadUT MUST be called first
    pressure = myBarometer.bmp085GetPressure(myBarometer.bmp085ReadUP());//Get the temperature
    altitude = myBarometer.calcAltitude(pressure); //Uncompensated calculation - in Meters
    atm = pressure / 101325;

    Serial.print("Temperature: ");
    Serial.print(temperature, 2); //display 2 decimal places
    Serial.println("deg C");

    Serial.print("Pressure: ");
    Serial.print(pressure, 0); //whole number only.
    Serial.println(" Pa");

    Serial.print("Ralated Atmosphere: ");
    Serial.println(atm, 4); //display 4 decimal places

    Serial.print("Altitude: ");
    Serial.print(altitude, 2); //display 2 decimal places
    Serial.println(" m");

    Serial.println();

    delay(1000); //wait a second and get values again.
}

Weird, that should just work. Give me a few days to get one of those sensors and I'll try it

If it helps, this is the barometer sensor I'm using:

I think the issue is that Barometer library linked in the page might have (numerical) bugs that were resolved by the new one GitHub - Seeed-Studio/Grove_Barometer_Sensor: test the barometer ; may you give this a spin?

I updated the library as you suggested and you are correct! It works correctly now. Thanks for looking in to this issue.