BMP280_DEV icon indicating copy to clipboard operation
BMP280_DEV copied to clipboard

Different i2c pin

Open baka-bukakke opened this issue 3 years ago • 0 comments

I'm trying the example code for esp32 with changes to test my bmp280 but couldn't because when trying to upload the error appears:

call of overloaded 'BMP280_DEV(const uint8_t&, const uint8_t&)' is ambiguous

I'm using a ttgo t8 with the esp32-wrover module. I even tried just verifying the code with the board esp32-wrover-module and esp32-devkit but it doesn't seem to make any difference. I saw the other issues that are closed now but I don't know how. Any help is appreciated, thanks. The example I'm trying to upload is:

#include <BMP280_DEV.h>                           // Include the BMP280_DEV.h library

float temperature, pressure, altitude;            // Create the temperature, pressure and altitude variables
BMP280_DEV bmp280(A6, A7);                        // Instantiate (create) a BMP280 object and set-up for I2C operation on pins SDA: 

void setup() 
{
  Serial.begin(115200);                           // Initialise the serial port
  bmp280.begin(BMP280_I2C_ALT_ADDR);                                 // Default initialisation, place the BMP280 into SLEEP_MODE 
  bmp280.setTimeStandby(TIME_STANDBY_2000MS);     // Set the standby time to 2 seconds
  bmp280.startNormalConversion();                 // Start BMP280 continuous conversion in NORMAL_MODE
}

void loop() 
{
  if (bmp280.getMeasurements(temperature, pressure, altitude))    // Check if the measurement is complete
  {
    Serial.print(temperature);                    // Display the results    
    Serial.print(F("*C   "));
    Serial.print(pressure);    
    Serial.print(F("hPa   "));
    Serial.print(altitude);
    Serial.println(F("m"));  
  }
}

edit: Downgrading to 1.0.18 seems to fix the problem, I just tested with just verifying but not uploading to my board. The error is gone. Further feedback is appreciated, thanks.

edit2: version 1.0.18 still couldn't use user defined pins for i2c, the example code uploads to board but doesn't show sensor readings

baka-bukakke avatar Jul 14 '22 16:07 baka-bukakke