[Swlug] smbus on Pi Pico

Rhys Sage rhys_sage at yahoo.com
Sun Apr 24 19:19:40 UTC 2022


The problem seems to be a lack of smbus in the insalled Python on the Pico (which uses MicroPython)

The BMP280 software works on Python on my 3B+

# Distributed with a free-will license.
# Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
# BMP280
# This code is designed to work with the BMP280_I2CS I2C Mini Module available from ControlEverything.com.
# https://www.controleverything.com/content/Barometer?sku=BMP280_I2CSs#tabs-0-product_tabset-2
#import sys
#sys.path.append("lib/")
#import lib/smbus.cpython-39-x86_64-linux-gnu.so
import time
# Get I2C bus
bus = smbus.SMBus(1)
# BMP280 address, 0x76(118)
# Read data back from 0x88(136), 24 bytes
b1 = bus.read_i2c_block_data(0x76, 0x88, 24)
# Convert the data
# Temp coefficents

On my Pi Pico I get an error


Rhys Sage



More information about the Swlug mailing list