Troynica / MS5611

MS5611 - barometric pressure sensor library for Arduino (SPI version)
MIT License
3 stars 0 forks source link

SPI request #1

Open magnum3131 opened 3 years ago

magnum3131 commented 3 years ago

Hi,

Thanks a lot for your library, i tried to make it work on ESP32.

I don't manage to make it work in SPI.

What's the method to declare the MS5611 in SPI

   // Address when using I2C,
   // CS (CSB) pin when using SPI (Arduino numbering)

MS5611 MS5611(ADDR);

I tried to declare ADDR on pin 26 (CSB port on ESP32) but it's not working

I always have the following values :

Temp: 20.00 P: 0.00 Temp: 20.00 P: 0.00 Temp: 20.00 P: 0.00

Thanks Julien

Troynica commented 3 years ago

Hi Julien,

Thank you for your comment. I have not worked on this for a long time. Also never tried in on other than AVR chips, although it should be possible. Firstly, I would try to figure out if you are in fact using the right pin. A way to do so is to flash the board with the Blink sketch using pin 26 for the LED pin and hook up an LED to it. If it blinks, you have the right pin. If the LED is not blinking, try finding the correct pin by subsequently connecting the LED to all the pins until you find it. You can either use that pin for the CS line or alter the pin number until you find it. Not sure about the ESP32, but when I use Arduino IDE with an ARM board, I specify the pins using numbers like PA2, PB3 etc.

Roy

RobTillaart commented 2 years ago

@magnum3131 Don't know if this is solved, but you might check my experimental version of - https://github.com/RobTillaart/MS5611_SPI It have it working with ESP32, the ROM reads are identical, so protocol wise it works.

Warning: there is a self heating issue with the GY-63 breakout which is not understood. No cause and solution found yet. The lib has a sort of workaround with an offset, but that is not taken into account for the 2nd order compensation.

For 5V boards one does need a level converter, (not tested , but expect it will work)