adafruit / Adafruit_BMP280_Library

Arduino Library for BMP280 sensors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typo correction

kostashellas opened this issue · comments

Hello team,
the below alternative I2C address doesn't work, I guess because of a typo error \in line

#define BMP280_ADDRESS_ALT \ (0x76) /**< Alternative I2C address for the sensor. */

regards Kostas

ok! would you be able to submit a tested PR? then we'd merge it :)

Just took a quick look at this. The \ is being added by clang-format to break up the "long" line. It's not a typo.

Your example above is all on one line while the actual library code is on two lines:

#define BMP280_ADDRESS_ALT \
(0x76) /**< Alternative I2C address for the sensor. */

It needs to be on two lines. Specifically - the continuation character needs to be the last character on the line.

Can you clarify how it does not work?

If you are getting a compile error, see if something has altered your local copy of Adafruit_BMP280.h for some reason.

If you can't get the sensor to work with that address, make sure you have the address select jumpered correctly on the breakout.

This example compiles are runs as expected:

#include <Adafruit_BMP280.h>

void setup() {
  Serial.begin(9600);
  while (!Serial);

  Serial.println(BMP280_ADDRESS);
  Serial.println(BMP280_ADDRESS_ALT);
}

void loop() {
}

Screenshot from 2021-01-20 10-18-50

Closing due to lack of response.