Hello,
I got today my new Photon and tried to connect it to a Bosch BME280. For that I wired SCL to D1 and SDA to D0. Then I wrote a small test app:
// This #include statement was automatically added by the Particle IDE.
#include "Adafruit_Sensor/Adafruit_Sensor.h"
// This #include statement was automatically added by the Particle IDE.
#include "Adafruit_BME280/Adafruit_BME280.h"
#define SEALEVELPRESSURE_HPA (1013.25)
Adafruit_BME280 bme;
void setup() {
bme.begin();
Particle.publish("Reboot");
}
void loop() {
Particle.publish("Temperature", bme.readTemperature());
Particle.publish("Pressure", bme.readPressure() / 100.0F);
Particle.publish("Altitude", bme.readAltitude(SEALEVELPRESSURE_HPA));
Particle.publish("Humidity", bme.readHumidity());
delay(20000);
}
The compiling went fine and the app started on my Photon. In the dashboard I could see that there were no sensor data incoming. So I wanted to change the I2C address from 0x77 to 0x76. For that I had to clone the Adafruit library and change the address in Adafruit_BME280.h
. But when I try to compile the app with the custom library I’m getting the following error message:
Adafruit_BME280/Adafruit_BME280.cpp: In member function 'uint32_t Adafruit_BME280::read24(byte)':
Adafruit_BME280/Adafruit_BME280.cpp:247:11: error: 'class SPIClass' has no member named 'beginTransaction'
SPI.beginTransaction(SPISettings(500000, MSBFIRST, SPI_MODE0));
^
Adafruit_BME280/Adafruit_BME280.cpp:247:67: error: 'SPISettings' was not declared in this scope
SPI.beginTransaction(SPISettings(500000, MSBFIRST, SPI_MODE0));
^
Adafruit_BME280/Adafruit_BME280.cpp:259:11: error: 'class SPIClass' has no member named 'endTransaction'
SPI.endTransaction(); // release the SPI bus
^
make[1]: *** [../build/target/user/platform-6Adafruit_BME280/Adafruit_BME280.o] Error 1
make: *** [user] Error 2
Besides the I2C address I didn’t change anything in my fork. Hopefully somebody can give me a hint what I have done wrong. Thanks in advance!