Pico using I2C with pressure sensor

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
bdenn08
Posts: 1
Joined: Tue Jul 12, 2022 8:52 pm

Pico using I2C with pressure sensor

Post by bdenn08 » Tue Jul 12, 2022 9:07 pm

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

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Pico using I2C with pressure sensor

Post by jimmo » Wed Jul 13, 2022 12:17 am

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.

iceelon
Posts: 30
Joined: Tue Jul 12, 2022 11:42 am

Re: Pico using I2C with pressure sensor

Post by iceelon » Tue Jul 19, 2022 9:31 am

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

Post Reply