Hey, so I picked up a couple of these sensors but I can’t seem to get them to work…
First off I couldn’t find an exact example using the one I have… but this one seemed closest
Mine: Amazon Link
So since I am only wanting to get the Pressure off of this sensor I was hoping I would only need to hook up 1 data line, so only have 3 wires going to this sensor, am I correct in assuming I can do that?
I tried using this sketch to detect/read my sensor but it just gave me the error message to check wiring.
Thanks!
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
#define BMP_SCK 13
#define BMP_MISO 12
#define BMP_MOSI 11
#define BMP_CS 10
Adafruit_BMP280 bme; // I2C
//Adafruit_BMP280 bme(BMP_CS); // hardware SPI
//Adafruit_BMP280 bme(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);
void setup() {
Serial.begin(9600);
Serial.println(F("BMP280 test"));
if (!bme.begin()) {
Serial.println(F("Could not find a valid BMP280 sensor, check wiring!"));
while (1);
}
}
void loop() {
Serial.print(F("Temperature = "));
Serial.print(bme.readTemperature());
Serial.println(" *C");
Serial.print(F("Pressure = "));
Serial.print(bme.readPressure());
Serial.println(" Pa");
Serial.print(F("Approx altitude = "));
Serial.print(bme.readAltitude(1013.25)); // this should be adjusted to your local forcase
Serial.println(" m");
Serial.println();
delay(2000);
}