Hi all,
I'm using an nRF52-DK for testing the connections of pressure sensors (BME/BMP280), I tested first with arduino, and then I'm using the same code with Platformio in VScode.
The connection and code are the same so I'm not sure what is failing, maybe the declaration of pins.
an example would be:
#include <Wire.h> #include <SPI.h> #include <Adafruit_BMP280.h> #define BMP_SCK (13) #define BMP_MISO (12) #define BMP_MOSI (11) #define BMP_CS (10) Adafruit_BMP280 bmp(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK); void setup() { Serial.begin(9600); Serial.println(F("BMP280 test")); //if (!bmp.begin(BMP280_ADDRESS_ALT, BMP280_CHIPID)) { if (!bmp.begin()) { Serial.println(F("Could not find a valid BMP280 sensor, check wiring or " "try a different address!")); while (1) delay(10); } } void loop() { Serial.print(F("Pressure = ")); Serial.print(bmp.readPressure()); Serial.println(" Pa"); Serial.println(); delay(2000); }
In Arduino IDE using Arduino UNO it woks.
In VScode with the nRF52-DK, the Terminal will show "Could not find a valid BMP280 sensor, check wiring or "
"try a different address!"
Can someone help me with this? is there a better way to read the pressure from this sensor?