Page 1 of 1

Pico using I2C with pressure sensor

Posted: Tue Jul 12, 2022 9:07 pm
by bdenn08
Hi,

I'm rather new to MicroPython and the raspberry Pico, and I have been tasked with using I2C to read in data from the Honeywell
HSCDANN015PA2A3 pressure sensor.

I've successfully scanned for the device and received the correct device address (0x28) using Thonny. I've attempted to use a couple of different functions consisting of commands including: readfrom_mem() and bytearray, but have had no luck.

Any help/example code is greatly appreciated,

Brandon

Re: Pico using I2C with pressure sensor

Posted: Wed Jul 13, 2022 12:17 am
by jimmo
bdenn08 wrote:
Tue Jul 12, 2022 9:07 pm
Any help/example code is greatly appreciated,
Here's an example i2c driver for an accelerometer. The general pattern is usually pretty similar where you use readfrom_mem and writeto_mem.

https://github.com/micropython/micropyt ... lsm9ds1.py

You will need to study the datasheet carefully to figure out all the registers you need to read/write. It helps to have an existing driver (e.g. written in C) to refer to.

Re: Pico using I2C with pressure sensor

Posted: Tue Jul 19, 2022 9:31 am
by iceelon
I found this is not specific to micropython but at least you can see how to pass parameters

Code: Select all

https://github.com/ExperimentalAvionics/EFIS_ModuleA