SPI connection to BMP388 not working

I am currently using an arduino uno and a bmp388 sensor. I tried to take in data through I2C but it didn't work. Now I'm trying to take in data through SPI but it won't work. I've followed the instructions https://learn.adafruit.com/adafruit-bmp388/arduino

I've connected everything correctly. SPI ports, 13,12,11,10 and then vin to 5V and GND to GND.
I've commented on the I2C code and uncommented the SPI code:

//Adafruit_BMP3XX bmp; // I2C
Adafruit_BMP3XX bmp(BMP_CS); // hardware SPI
Adafruit_BMP3XX bmp(BMP_CS, BMP_MOSI, BMP_MISO, BMP_SCK);

And it keeps giving me this error on the third line: redefinition of 'Adafruit_BMP3XX bmp'

In the I2C case I have plugged in SCK to A5 and SDI to A4. GND-GND and vin-5V. I've activated the I2C command and deactivated the SPI commands. All it prints out in serial is:

BMP388 test
Could not find a valid BMP3 sensor, check wiring!

When I tried the I2C code it just told me to check my wiring all the time

Please help.

And it keeps giving me this error on the third line: redefinition of 'Adafruit_BMP3XX bmp'

Sure, you must not uncomment two definitions. If you use hardware SPI uncomment the first one, if you use any other pins, uncomment the second one to activate a software emulation (much slower).

I am currently using an arduino uno and a bmp388 sensor.

As you link to the Adafruit site I assume you're using the breakout board from Adafruit and not the sensor directly. Is this assumption correct?

In the I2C case I have plugged in SCK to A5 and SDI to A4. GND-GND and vin-5V. I've activated the I2C command and deactivated the SPI commands. All it prints out in serial is:

Why didn't you use the SDA/SCL pins as the Adafruit documentation suggests? On the UNO the connection is exactly the same but it eliminates a lot of error as experience here in the forum shows.

I tried the hardware SPI and the software SPI and neighter worked. Both gave the same answer

BMP388 test
Could not find a valid BMP3 sensor, check wiring!

And I have tried before hooking SCK to SCL on the arduino uno and SDI to SDA. But it gives the same result.

I think it might not be detecting the bmp388 becouse I haven't soldered it in any way. Currently using normal cables that I've stuck through the holes of the BMP388 into a breadbord. But it does make a sound on my computer when I plug in the GND cable.

Could this be the problem pylos?

I think it might not be detecting the bmp388 becouse I haven't soldered it in any way. Currently using normal cables that I've stuck through the holes of the BMP388 into a breadbord. But it does make a sound on my computer when I plug in the GND cable.

The BMP388 doesn't have holes. I guess you're using some breakout board but you didn't answer my question about which one you're using.

Why do you expect your computer to make any sound? It would be a very bad sign if your computer makes sounds...

Post a sharp picture of your setup where all connections are clearly visible!

I am not expecting it to make sound. But when I plug in the GND to GND windows will make a sound as if something was plugged in like an usb stick etc.

Here's a picture of the breakout board: Adafruit BMP388 - Precision Barometric Pressure and Altimeter [STEMMA QT] : ID 3966 : $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits

Don't really know how to insert pictures from my own computer on this forum

Basically using these types of cables that I run from my arduino to the breakoutboard that is places on a breadboard.

I am not expecting it to make sound. But when I plug in the GND to GND windows will make a sound as if something was plugged in like an usb stick etc.

Very bad sign. This usually means that the board connected to the PC (probably the Arduino) does reset for some reason.

Here's a picture of the breakout board: Adafruit BMP388 - Precision Barometric Pressure and Altimeter [STEMMA QT] : ID 3966 : $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits

So you have the original board from Adafruit?

Don't really know how to insert pictures from my own computer on this forum

Attach it to the post.

Here

It’s working now.