I Have a BMP280 wired up to my Arduino micro like shown in the attachments. When I upload the following code I sometimes get a “#”, “$”, “!”, or whatever symbol it may be, but I don’t know why.
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_BMP280.h>
#define BMP_CS (4)
Adafruit_BMP280 bmp(BMP_CS);
void setup() {
Serial.begin(9600);
if (!bmp.begin()) {
Serial.println(F("Could not find a valid BMP280 sensor, check wiring!"));
}
bmp.setSampling(Adafruit_BMP280::MODE_NORMAL,
Adafruit_BMP280::SAMPLING_X2,
Adafruit_BMP280::SAMPLING_X16,
Adafruit_BMP280::FILTER_X16,
Adafruit_BMP280::STANDBY_MS_500);
}
void loop() {
Serial.write("A=");
Serial.write(bmp.readAltitude(1013.25));
Serial.write("\n");
delay(500);
}
I’m kind of new to this but if I were to take a guess I’d think it’s some sort of way of saying something could be wrong with wiring or something like that, though I don’t have any evidence for that. I have also tried wiring up the bmp280 with i2c and software SPI but they did not work either.