I get the value of symbols like "#" "$" "!" ect. with bmp280 with hardware SPI.

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() {

  if (!bmp.begin()) {
    Serial.println(F("Could not find a valid BMP280 sensor, check wiring!"));


void loop() {



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.

If by 'I sometimes get' you mean what appears in the Serial monitor, then you might want to check the Arduino reference for Serial.Write, just to make sure your using it correctly.

Replace the Serial.write() with Serial.print() or Serial.println() and it will work a lot better.

Indeed do look up the difference between the two :slight_smile:

write() doesn't do any conversion, it just pushes out 8 bits as is from the internal representation.
You want a human-readable string representing a number, you have to use print().